I have encountered some oddities when using wxAUI along with IMPLEMENT_APP_NO_MAIN; for instance, panels can't be docked and undocked anymore. I'm using MSVC2005 and wxWidgets 2.8.0. Has anyone ever encountered these problems before? Is there any workaround?
The behaviour can be reproduced in the auidemo application by replacing lines 49 and 50 in auidemo.cpp:
- Code: Select all
DECLARE_APP(MyApp)
IMPLEMENT_APP_NO_MAIN(MyApp)
and adding the following code at the very end of the file:
- Code: Select all
#define IDC_TESTAPP 109
#define MAX_LOADSTRING 100
// Global Variables:
HINSTANCE hInst;
TCHAR szTitle[MAX_LOADSTRING];
TCHAR szWindowClass[MAX_LOADSTRING];
// Forward declaration:
BOOL InitInstance(HINSTANCE, int);
int APIENTRY _tWinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
MSG msg;
HACCEL hAccelTable;
if (!InitInstance (hInstance, nCmdShow))
{
return FALSE;
}
hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_TESTAPP));
// Main message loop:
while (GetMessage(&msg, NULL, 0, 0))
{
if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
return (int) msg.wParam;
}
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
{
WXDLLIMPEXP_BASE void wxSetInstance(HINSTANCE hInst);
wxSetInstance(hInstance);
wxApp::m_nCmdShow = nCmdShow;
int argc = 0;
wxChar **argv = NULL;
wxEntryStart(argc, argv);
if ( !wxTheApp || !wxTheApp->CallOnInit() )
return FALSE;
return TRUE;
}
Any help would be appreciated.