]>
git.saurik.com Git - wxWidgets.git/blob - src/msw/basemsw.cpp
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: msw/basemsw.cpp
3 // Purpose: misc stuff only used in console applications under MSW
4 // Author: Vadim Zeitlin
8 // Copyright: (c) 2003 Vadim Zeitlin <vadim@wxwindows.org>
9 // License: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
12 // ============================================================================
14 // ============================================================================
16 // ----------------------------------------------------------------------------
18 // ----------------------------------------------------------------------------
20 // for compilers that support precompilation, includes "wx.h".
21 #include "wx/wxprec.h"
31 #include "wx/apptrait.h"
32 #include "wx/evtloop.h"
33 #include "wx/msw/private/timer.h"
34 // MBN: this is a workaround for MSVC 5: if it is not #included in
35 // some wxBase file, wxRecursionGuard methods won't be exported from
36 // wxBase.dll, and MSVC 5 will give linker errors
37 #include "wx/recguard.h"
40 #include "wx/msw/private.h"
42 // ============================================================================
43 // wxAppTraits implementation
44 // ============================================================================
46 WXDWORD
wxAppTraits::DoSimpleWaitForThread(WXHANDLE hThread
)
48 return ::WaitForSingleObject((HANDLE
)hThread
, INFINITE
);
51 // ============================================================================
52 // wxConsoleAppTraits implementation
53 // ============================================================================
55 void *wxConsoleAppTraits::BeforeChildWaitLoop()
61 void wxConsoleAppTraits::AfterChildWaitLoop(void * WXUNUSED(data
))
66 bool wxConsoleAppTraits::DoMessageFromThreadWait()
68 // nothing to process here
74 wxTimerImpl
*wxConsoleAppTraits::CreateTimerImpl(wxTimer
*timer
)
76 return new wxMSWTimerImpl(timer
);
81 wxEventLoopBase
*wxConsoleAppTraits::CreateEventLoop()
83 #if wxUSE_CONSOLE_EVENTLOOP
84 return new wxEventLoop();
85 #else // !wxUSE_CONSOLE_EVENTLOOP
87 #endif // wxUSE_CONSOLE_EVENTLOOP/!wxUSE_CONSOLE_EVENTLOOP
91 WXDWORD
wxConsoleAppTraits::WaitForThread(WXHANDLE hThread
)
93 return DoSimpleWaitForThread(hThread
);
96 bool wxConsoleAppTraits::WriteToStderr(const wxString
& text
)
98 return wxFprintf(stderr
, "%s", text
) != -1;