]>
git.saurik.com Git - wxWidgets.git/blob - src/msw/basemsw.cpp
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: src/msw/basemsw.cpp
3 // Purpose: misc stuff only used in console applications under MSW
4 // Author: Vadim Zeitlin
7 // Copyright: (c) 2003 Vadim Zeitlin <vadim@wxwindows.org>
8 // Licence: wxWindows licence
9 ///////////////////////////////////////////////////////////////////////////////
11 // ============================================================================
13 // ============================================================================
15 // ----------------------------------------------------------------------------
17 // ----------------------------------------------------------------------------
19 // for compilers that support precompilation, includes "wx.h".
20 #include "wx/wxprec.h"
30 #include "wx/apptrait.h"
31 #include "wx/evtloop.h"
32 #include "wx/msw/private/timer.h"
33 // MBN: this is a workaround for MSVC 5: if it is not #included in
34 // some wxBase file, wxRecursionGuard methods won't be exported from
35 // wxBase.dll, and MSVC 5 will give linker errors
36 #include "wx/recguard.h"
39 #include "wx/msw/private.h"
41 // ============================================================================
42 // wxAppTraits implementation
43 // ============================================================================
46 WXDWORD
wxAppTraits::DoSimpleWaitForThread(WXHANDLE hThread
)
48 return ::WaitForSingleObject((HANDLE
)hThread
, INFINITE
);
50 #endif // wxUSE_THREADS
52 // ============================================================================
53 // wxConsoleAppTraits implementation
54 // ============================================================================
56 void *wxConsoleAppTraits::BeforeChildWaitLoop()
62 void wxConsoleAppTraits::AfterChildWaitLoop(void * WXUNUSED(data
))
68 bool wxConsoleAppTraits::DoMessageFromThreadWait()
70 // nothing to process here
74 WXDWORD
wxConsoleAppTraits::WaitForThread(WXHANDLE hThread
, int WXUNUSED(flags
))
76 return DoSimpleWaitForThread(hThread
);
78 #endif // wxUSE_THREADS
82 wxTimerImpl
*wxConsoleAppTraits::CreateTimerImpl(wxTimer
*timer
)
84 return new wxMSWTimerImpl(timer
);
89 wxEventLoopBase
*wxConsoleAppTraits::CreateEventLoop()
91 #if wxUSE_CONSOLE_EVENTLOOP
92 return new wxEventLoop();
93 #else // !wxUSE_CONSOLE_EVENTLOOP
95 #endif // wxUSE_CONSOLE_EVENTLOOP/!wxUSE_CONSOLE_EVENTLOOP
99 bool wxConsoleAppTraits::WriteToStderr(const wxString
& text
)
101 return wxFprintf(stderr
, "%s", text
) != -1;