Karl Karpfen
2014-10-12 16:38:14 UTC
Hi,
I have a strange problem that happens in Release-Build only (Unicode
Release DLL). For some reasons I can't update to wxWidgets 3.0 now so every
hint/idea/suggestion on how to solve this with 2.8 is welcome!
I'm using a Windows-Application (WinMain()-entry point) that itself
accesses a DLL. This DLL initialises and uses wxWidgets, the main
application does not have any dependencies to wxWidgets. This is the code
inside the DLL that works smoothly when I run this software in Debug-Build:
if (!wxApp::GetInstance())
{
appThread=oapc_thread_create(appCreator,NULL);
if (!initValues.appThread) return -1;
for (int i=0; i<10; i++)
{
oapc_thread_sleep(100);
if (wxApp::IsMainLoopRunning()) break;
}
if (!wxApp::IsMainLoopRunning()) return -1;
}
This creates an own thread "appCreator" and afterwards checks for some time
if the wxWidgetsMainLoop is running. Within this thread wxWidgets is
initialised:
static void* appCreator(void* /*data*/)
{
const HINSTANCE hInstance =GetModuleHandle(NULL);
if ( !hInstance ) return NULL;
wxInitializer wxinit;
if ( !wxinit.IsOk() ) return 0; // failed to init wx
wxEntry(hInstance);
return NULL;
}
Here initialisation seem to fail in Release-Build in wxEntry(hInstance),
this function returns immediately. Since this happens in Release only, I
can't really check what the reason is, debugging does not work here.
Just to mention: For Linux function appCreator contains just this code
which works well in both, Debug and Release (using this code for Windows
does not solve the problem):
int argc=0;
wxEntry(argc,(char**)NULL);
So...anybody an idea what is wrong here?
Thanks!
I have a strange problem that happens in Release-Build only (Unicode
Release DLL). For some reasons I can't update to wxWidgets 3.0 now so every
hint/idea/suggestion on how to solve this with 2.8 is welcome!
I'm using a Windows-Application (WinMain()-entry point) that itself
accesses a DLL. This DLL initialises and uses wxWidgets, the main
application does not have any dependencies to wxWidgets. This is the code
inside the DLL that works smoothly when I run this software in Debug-Build:
if (!wxApp::GetInstance())
{
appThread=oapc_thread_create(appCreator,NULL);
if (!initValues.appThread) return -1;
for (int i=0; i<10; i++)
{
oapc_thread_sleep(100);
if (wxApp::IsMainLoopRunning()) break;
}
if (!wxApp::IsMainLoopRunning()) return -1;
}
This creates an own thread "appCreator" and afterwards checks for some time
if the wxWidgetsMainLoop is running. Within this thread wxWidgets is
initialised:
static void* appCreator(void* /*data*/)
{
const HINSTANCE hInstance =GetModuleHandle(NULL);
if ( !hInstance ) return NULL;
wxInitializer wxinit;
if ( !wxinit.IsOk() ) return 0; // failed to init wx
wxEntry(hInstance);
return NULL;
}
Here initialisation seem to fail in Release-Build in wxEntry(hInstance),
this function returns immediately. Since this happens in Release only, I
can't really check what the reason is, debugging does not work here.
Just to mention: For Linux function appCreator contains just this code
which works well in both, Debug and Release (using this code for Windows
does not solve the problem):
int argc=0;
wxEntry(argc,(char**)NULL);
So...anybody an idea what is wrong here?
Thanks!
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users