Sirius wrote:
> I need some info from my App, so I would like to use wxGetApp() to get
> my App but it is fail :-(
>
> If I #include "myApp.h" in "myFrame.h":
> myApp.h(3) : error C2011: 'CSxApp' : 'class' type redefinition
>
> If I didn't #include "myApp.h" in "myFrame.h":
> myFrame.cpp(99) : error C2065: 'wxGetApp' : undeclared identifier
>
>
>
> Here is my code:
> ------------------------
> //myApp.h
> #include "wx/wx.h"
>
> class CSxApp: public wxApp
> {
> virtual bool OnInit();
> ........... (other..)
> };
>
> DECLARE_APP(CSxApp)
>
> --------------------------
> //myFrame.h
>
> ...
> #include "myApp.h"
> ....
>
> --------------------------
> //myFrame.cpp
>
> wxMessageBox(wxGetApp().GetAppName());
>
> ---------------------------
>
>
>
>
> Thanks,
> Sirius
>
> WX: 2.5.1
> OS: WinXP Pro
> COMPILER: VC++ 6.0
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wx-users-u...@lists.wxwidgets.org
> For additional commands, e-mail: wx-use...@lists.wxwidgets.org
>
>
>
--
Thanks,
Sirius
WX: 2.5.1
OS: WinXP Pro
COMPILER: VC++ 6.0
> Here is my code:
> ------------------------
> //myApp.h
#ifndef MYAPP_H_INCLUDED
#define MYAPP_H_INCLUDED
> #include "wx/wx.h"
>
> class CSxApp: public wxApp
> {
> virtual bool OnInit();
> ........... (other..)
> };
>
> DECLARE_APP(CSxApp)
#endif
>
> --------------------------
> //myFrame.h
here the same to avoid multiple inclusion
>
> ...
> #include "myApp.h"
> ....
>
> --------------------------
> //myFrame.cpp
>
> wxMessageBox(wxGetApp().GetAppName());
>
> ---------------------------
>
>
>
>
> Thanks,
> Sirius
>
> WX: 2.5.1
> OS: WinXP Pro
> COMPILER: VC++ 6.0
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wx-users-u...@lists.wxwidgets.org
> For additional commands, e-mail: wx-use...@lists.wxwidgets.org
>
--
+-------------------------
| Urs Weder
| N 47°23'23" E 9°39'47"
+-------------------------
( modify address for return email )