]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/dll/my_dll.cpp
Fixed help for symbol picker and style manager dialogs
[wxWidgets.git] / samples / dll / my_dll.cpp
index 8097479b7bf84634e708b68102253a10b9ef61e4..94afd5045b5b855d21ebf3a88ad8735801299912 100644 (file)
@@ -22,8 +22,8 @@
     #pragma hdrstop
 #endif
 
-#ifndef __WXMSW__
-    #error "This sample is MSW-only"
+#ifndef __WINDOWS__
+    #error "This sample is Windows-only"
 #endif
 
 #include "wx/app.h"
@@ -148,12 +148,11 @@ MyDllApp::MyDllApp()
     // by shutting the thread down when it's no longer needed, though.
     SetExitOnFrameDelete(false);
 
-    Connect(wxEVT_IDLE, wxIdleEventHandler(MyDllApp::OnIdle));
     Connect(CMD_SHOW_WINDOW,
-            wxEVT_COMMAND_THREAD,
+            wxEVT_THREAD,
             wxThreadEventHandler(MyDllApp::OnShowWindow));
     Connect(CMD_TERMINATE,
-            wxEVT_COMMAND_THREAD,
+            wxEVT_THREAD,
             wxThreadEventHandler(MyDllApp::OnTerminate));
 }
 
@@ -231,7 +230,9 @@ unsigned wxSTDCALL MyAppLauncher(void* event)
 // public DLL interface
 // ----------------------------------------------------------------------------
 
-extern "C" WXEXPORT
+extern "C"
+{
+
 void run_wx_gui_from_dll(const char *title)
 {
     // In order to prevent conflicts with hosting app's event loop, we
@@ -286,14 +287,12 @@ void run_wx_gui_from_dll(const char *title)
 
     // Send a message to wx thread to show a new frame:
     wxThreadEvent *event =
-        new wxThreadEvent(wxEVT_COMMAND_THREAD, CMD_SHOW_WINDOW);
+        new wxThreadEvent(wxEVT_THREAD, CMD_SHOW_WINDOW);
     event->SetString(title);
     wxQueueEvent(wxApp::GetInstance(), event);
 }
 
-
-extern "C" WXEXPORT
-void wx_dll_cleanup(void)
+void wx_dll_cleanup()
 {
     wxCriticalSectionLocker lock(gs_wxStartupCS);
 
@@ -303,7 +302,7 @@ void wx_dll_cleanup(void)
     // If wx main thread is running, we need to stop it. To accomplish this,
     // send a message telling it to terminate the app.
     wxThreadEvent *event =
-        new wxThreadEvent(wxEVT_COMMAND_THREAD, CMD_TERMINATE);
+        new wxThreadEvent(wxEVT_THREAD, CMD_TERMINATE);
     wxQueueEvent(wxApp::GetInstance(), event);
 
     // We must then wait for the thread to actually terminate.
@@ -311,3 +310,5 @@ void wx_dll_cleanup(void)
     CloseHandle(gs_wxMainThread);
     gs_wxMainThread = NULL;
 }
+
+} // extern "C"