From b0aaac3890a2fdc0cec0ef974d4137fad767512b Mon Sep 17 00:00:00 2001 From: Sonicadvance1 Date: Sat, 13 Sep 2008 17:40:21 +0000 Subject: [PATCH] Should fix about box in Windows git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@519 8ced0084-cf51-0410-be5f-012b33b47a6e --- .../Plugin_Wiimote_Test/Src/Wiimote_Test.cpp | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/Source/Plugins/Plugin_Wiimote_Test/Src/Wiimote_Test.cpp b/Source/Plugins/Plugin_Wiimote_Test/Src/Wiimote_Test.cpp index 7e475c2405..b5d41fbd72 100644 --- a/Source/Plugins/Plugin_Wiimote_Test/Src/Wiimote_Test.cpp +++ b/Source/Plugins/Plugin_Wiimote_Test/Src/Wiimote_Test.cpp @@ -77,7 +77,50 @@ static u32 convert24bit(const u8* src) { static u16 convert16bit(const u8* src) { return (src[0] << 8) | src[1]; } +#ifdef _WIN32 +HINSTANCE g_hInstance; +class wxDLLApp : public wxApp +{ + bool OnInit() + { + return true; + } +}; +IMPLEMENT_APP_NO_MAIN(wxDLLApp) + +WXDLLIMPEXP_BASE void wxSetInstance(HINSTANCE hInst); + + +BOOL APIENTRY DllMain(HINSTANCE hinstDLL, // DLL module handle + DWORD dwReason, // reason called + LPVOID lpvReserved) // reserved +{ + switch (dwReason) + { + case DLL_PROCESS_ATTACH: + { //use wxInitialize() if you don't want GUI instead of the following 12 lines + wxSetInstance((HINSTANCE)hinstDLL); + int argc = 0; + char **argv = NULL; + wxEntryStart(argc, argv); + if ( !wxTheApp || !wxTheApp->CallOnInit() ) + return FALSE; + } + break; + + case DLL_PROCESS_DETACH: + CloseConsole(); + wxEntryCleanup(); //use wxUninitialize() if you don't want GUI + break; + default: + break; + } + + g_hInstance = hinstDLL; + return TRUE; +} +#endif //****************************************************************************** // Exports //******************************************************************************