]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/app.cpp
compilation fixes after c_str() changes (due to casting of its return value to non...
[wxWidgets.git] / src / msw / app.cpp
index 1554e8637ed06c0fa29b069fc1cf1aff05ca7617..3c72ccbde89843d8e136f9840f945b3cd67e9e09 100644 (file)
 #include <string.h>
 #include <ctype.h>
 
-// For MB_TASKMODAL
-#ifdef __WXWINCE__
-#include "wx/msw/wince/missing.h"
-#endif
+#include "wx/msw/missing.h"
 
 // instead of including <shlwapi.h> which is not part of the core SDK and not
 // shipped at all with other compilers, we always define the parts of it we
@@ -227,6 +224,13 @@ bool wxGUIAppTraits::DoMessageFromThreadWait()
 
 DWORD wxGUIAppTraits::WaitForThread(WXHANDLE hThread)
 {
+    // if we don't have a running event loop, we shouldn't wait for the
+    // messages as we never remove them from the message queue and so we enter
+    // an infinite loop as MsgWaitForMultipleObjects() keeps returning
+    // WAIT_OBJECT_0 + 1
+    if ( !wxEventLoop::GetActive() )
+        return DoSimpleWaitForThread(hThread);
+
     return ::MsgWaitForMultipleObjects
              (
                1,                   // number of objects to wait for
@@ -765,30 +769,3 @@ terminate the program,\r\n\
 }
 
 #endif // wxUSE_EXCEPTIONS
-
-// ----------------------------------------------------------------------------
-// deprecated event loop functions
-// ----------------------------------------------------------------------------
-
-#if WXWIN_COMPATIBILITY_2_4
-
-void wxApp::DoMessage(WXMSG *pMsg)
-{
-    wxEventLoop *evtLoop = wxEventLoop::GetActive();
-    if ( evtLoop )
-        evtLoop->ProcessMessage(pMsg);
-}
-
-bool wxApp::DoMessage()
-{
-    wxEventLoop *evtLoop = wxEventLoop::GetActive();
-    return evtLoop ? evtLoop->Dispatch() : false;
-}
-
-bool wxApp::ProcessMessage(WXMSG* pMsg)
-{
-    wxEventLoop *evtLoop = wxEventLoop::GetActive();
-    return evtLoop && evtLoop->PreProcessMessage(pMsg);
-}
-
-#endif // WXWIN_COMPATIBILITY_2_4