]> git.saurik.com Git - wxWidgets.git/commitdiff
Use wxGetInstance() instead of wxhInstance in wxMSW code.
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 25 Feb 2010 00:03:59 +0000 (00:03 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 25 Feb 2010 00:03:59 +0000 (00:03 +0000)
No real changes, just use an accessor function instead of directly accessing
the global variable.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63554 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/msw/private.h
src/msw/app.cpp
src/msw/msgdlg.cpp

index 2d75ccdf6a12ae88035862a9bde506414f1eccb3..9683257776a411de2f4880065737114db3ef30e7 100644 (file)
@@ -62,6 +62,13 @@ extern WXDLLIMPEXP_DATA_CORE(HFONT) wxSTATUS_LINE_FONT;
 
 extern WXDLLIMPEXP_DATA_BASE(HINSTANCE) wxhInstance;
 
+extern "C"
+{
+    WXDLLIMPEXP_BASE HINSTANCE wxGetInstance();
+}
+
+WXDLLIMPEXP_BASE void wxSetInstance(HINSTANCE hInst);
+
 // ---------------------------------------------------------------------------
 // define things missing from some compilers' headers
 // ---------------------------------------------------------------------------
@@ -769,7 +776,7 @@ public:
     {
         if ( IsRegistered() )
         {
-            if ( !::UnregisterClass(m_clsname.wx_str(), wxhInstance) )
+            if ( !::UnregisterClass(m_clsname.wx_str(), wxGetInstance()) )
             {
                 wxLogLastError(wxT("UnregisterClass"));
             }
@@ -839,13 +846,6 @@ private:
 // global functions
 // ---------------------------------------------------------------------------
 
-extern "C"
-{
-    WXDLLIMPEXP_BASE HINSTANCE wxGetInstance();
-}
-
-WXDLLIMPEXP_BASE void wxSetInstance(HINSTANCE hInst);
-
 // return the full path of the given module
 inline wxString wxGetFullModuleName(HMODULE hmod)
 {
index 0e79d4627f32896f9f4b52139eb8d21b15c85f3d..037032c870aa4c9ef432c1f1e66baa2f542507ad 100644 (file)
@@ -659,7 +659,7 @@ const wxChar *wxApp::GetRegisteredClassName(const wxChar *name,
     wxZeroMemory(wndclass);
 
     wndclass.lpfnWndProc   = (WNDPROC)wxWndProc;
-    wndclass.hInstance     = wxhInstance;
+    wndclass.hInstance     = wxGetInstance();
     wndclass.hCursor       = ::LoadCursor(NULL, IDC_ARROW);
     wndclass.hbrBackground = (HBRUSH)wxUIntToPtr(bgBrushCol + 1);
     wndclass.style         = CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS | extraStyles;
@@ -693,7 +693,7 @@ const wxChar *wxApp::GetRegisteredClassName(const wxChar *name,
     {
         wxLogLastError(wxString::Format(wxT("RegisterClass(%s)"),
                        regClass.regname));
-        ::UnregisterClass(regClass.regname.c_str(), wxhInstance);
+        ::UnregisterClass(regClass.regname.c_str(), wxGetInstance());
         return NULL;
     }
 
@@ -725,13 +725,13 @@ void wxApp::UnregisterWindowClasses()
     for ( size_t n = 0; n < count; n++ )
     {
         const ClassRegInfo& regClass = gs_regClassesInfo[n];
-        if ( !::UnregisterClass(regClass.regname.c_str(), wxhInstance) )
+        if ( !::UnregisterClass(regClass.regname.c_str(), wxGetInstance()) )
         {
             wxLogLastError(wxString::Format(wxT("UnregisterClass(%s)"),
                            regClass.regname));
         }
 
-        if ( !::UnregisterClass(regClass.regnameNR.c_str(), wxhInstance) )
+        if ( !::UnregisterClass(regClass.regnameNR.c_str(), wxGetInstance()) )
         {
             wxLogLastError(wxString::Format(wxT("UnregisterClass(%s)"),
                            regClass.regnameNR));
index d0ddb15ac087724b71cac9d8b783b9a79a7492d2..43ed4e1c6eca9b07eab039b215a3e65d6f050aa6 100644 (file)
@@ -267,7 +267,7 @@ void wxMessageDialog::ReplaceStaticWithEdit()
                         rc.right - rc.left, rc.bottom - rc.top,
                         GetHwnd(),
                         NULL,
-                        wxhInstance,
+                        wxGetInstance(),
                         NULL
                       );