List Info

Thread: Application functions members called from another class and cpp file...




Application functions members called from another class and cpp file...
country flaguser name
United States
2007-07-26 15:48:56

I just bought Dialogblocks : helpfull GUI tool!

I defined member data (to store various version strings) in the
Application class (with Dialogblocks)
DB created member functions... until now it's allright
I want to get version informations from another dialog class and cpp
file (a popup copyright dialog box)
Trying to access those members function of my application class I
include MyApplication.h in myInfoDialog.cpp ,
and in the code, at the end of createControls function of my dialog
box, I use myApplicationInstanceName->getACopyrightInformation() to
get the member string.
I got an error message from DevCpp :
"expected primary-expression before '->' token "
With the include, the code completion is OK with
myApplicationInstanceName and the member function names !?

Next I try to access the application instance with :
wxGetApp()->getACopyrightInformation()
error message:
"base operand of `->' has non-pointer type `myApplicationInstanceName' "
or with :
wxTheApp->getACopyrightInformation()
error messsage :
" 'class wxApp' has no member named 'getACopyrightInformation' "

I really want to store application informations in the application
class... wath's the way?

Thanks a lot for your help

DoMi

(note: all the names are fake but explicit)

__._,_.___
.

__,_._,___
Re: Application functions members called from another class and cpp file...
country flaguser name
United States
2007-07-26 18:20:13

Sorry but I found solution at :
http://wxforum.shadonet.com/viewtopic.php?t=6449&highlight=application+members

Only changing :
> wxGetApp()->getACopyrightInformation()
into :
> wxGetApp().getACopyrightInformation()
works now for application members accessing

while testing, I realized I can't manage to access class members in
an other cpp files even if it's header file name is included in the
calling cpp file...
I try the suggested solution creating a static member which represents
itself in the called class!? It works but it's rather a twisted
solution...

Isn't there a more simple way to access class (and it's file) from
another one?

thanks in advance for your advices

DoMi

__._,_.___
.

__,_._,___
[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )