HINSTANCE wxhInstance = 0;
QMSG svCurrentMsg;
wxApp* wxTheApp = NULL;
+HAB vHabmain = NULL;
// FIXME why not const? and not static?
HBRUSH wxDisableButtonBrush = (HBRUSH) 0;
-MRESULT wxWndProc(HWND, UINT, MPARAM, MPARAM);
+MRESULT wxWndProc( HWND
+ ,ULONG
+ ,MPARAM
+ ,MPARAM
+ );
// ===========================================================================
// implementation
// wxApp
// ---------------------------------------------------------------------------
-#if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxApp, wxEvtHandler)
BEGIN_EVENT_TABLE(wxApp, wxEvtHandler)
EVT_END_SESSION(wxApp::OnEndSession)
EVT_QUERY_END_SESSION(wxApp::OnQueryEndSession)
END_EVENT_TABLE()
-#endif
//// Initialize
bool wxApp::Initialize(
// This is to foil optimizations in Visual C++ that throw out dummy.obj.
// PLEASE DO NOT ALTER THIS.
-#if !defined(WXMAKINGDLL)
+#if !defined(WXMAKINGDLL) && defined(__VISAGECPP__)
extern char wxDummyChar;
if (wxDummyChar) wxDummyChar++;
#endif
HAB vHab
)
{
-
- if (!::WinRegisterClass( vHab
- ,wxFrameClassName
- ,(PFNWP)wxWndProc
- ,CS_SIZEREDRAW | CS_SYNCPAINT | CS_HITTEST | CS_CLIPCHILDREN | CS_FRAME
- ,0
- ))
+ APIRET rc;
+
+ if ((rc = ::WinRegisterClass( vHab
+ ,wxFrameClassName
+ ,(PFNWP)wxWndProc
+ ,CS_SIZEREDRAW | CS_SYNCPAINT | CS_HITTEST | CS_CLIPCHILDREN | CS_FRAME
+ ,0
+ )) != 0)
{
wxLogLastError("RegisterClass(frame)");
, char* argv[]
)
{
- HAB vHab;
+ HAB vHab = 0;
if (!wxApp::Initialize(vHab))
return 0;
bool wxApp::OnInitGui()
{
- m_vHab = WinInitialize(0);
- m_hMq = WinCreateMsgQueue(m_vHab, 0);
+ vHabmain = WinInitialize(0);
+ m_hMq = WinCreateMsgQueue(vHabmain, 0);
return TRUE;
}
wxApp::~wxApp()
{
+#if wxUSE_UNICODE
// Delete command-line args
int i;
for (i = 0; i < argc; i++)
delete[] argv[i];
}
delete[] argv;
+#endif
}
bool wxApp::Initialized()
//
bool wxApp::DoMessage()
{
- BOOL bRc = ::WinGetMsg(m_vHab, &m_vMsg, HWND(NULL), 0, 0);
+ BOOL bRc = ::WinGetMsg(vHabmain, &m_vMsg, HWND(NULL), 0, 0);
if (bRc == 0)
{
if ( !ProcessMessage((WXMSG *)&vMsg) )
{
- ::WinDispatchMsg(m_vHab, &vMsg);
+ ::WinDispatchMsg(vHabmain, &vMsg);
}
}
svSavedMessages.Empty();
// Process the message
if (!ProcessMessage((WXMSG *)&svCurrentMsg) )
{
- ::WinDispatchMsg(m_vHab, (PQMSG)&svCurrentMsg);
+ ::WinDispatchMsg(vHabmain, (PQMSG)&svCurrentMsg);
}
}
return TRUE;
#if wxUSE_THREADS
wxMutexGuiLeaveOrEnter();
#endif // wxUSE_THREADS
- while (!::WinPeekMsg(m_vHab, &svCurrentMsg, (HWND)NULL, 0, 0, PM_NOREMOVE) &&
+ while (!::WinPeekMsg(vHabmain, &svCurrentMsg, (HWND)NULL, 0, 0, PM_NOREMOVE) &&
ProcessIdle() )
{
}
bool wxApp::Pending()
{
- return (::WinPeekMsg(m_vHab, (PQMSG)&svCurrentMsg, (HWND)NULL, 0, 0, PM_NOREMOVE) != 0);
+ return (::WinPeekMsg(vHabmain, (PQMSG)&svCurrentMsg, (HWND)NULL, 0, 0, PM_NOREMOVE) != 0);
}
void wxApp::Dispatch()
// Yield to incoming messages
bool wxYield()
{
- HAB vHab;
+ HAB vHab = 0;
QMSG vMsg;
// We want to go back to the main message loop
// if we see a WM_QUIT. (?)