]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/datecontrols.cpp
Update configuration for OpenVMS
[wxWidgets.git] / src / msw / datecontrols.cpp
index e8503510776cc5c8a53055afefcd4e56e6237276..0ea7e786a1a7cbb2a9b208e8296aa00bd7731b4d 100644 (file)
@@ -24,6 +24,8 @@
 #endif
 
 #ifndef WX_PRECOMP
+    #include "wx/app.h"
+    #include "wx/msw/wrapcctl.h"
 #endif // WX_PRECOMP
 
 #if wxUSE_DATEPICKCTRL || wxUSE_CALENDARCTRL
@@ -65,13 +67,22 @@ bool wxMSWDateControls::CheckInitialization()
         icex.dwSize = sizeof(icex);
         icex.dwICC = ICC_DATE_CLASSES;
 
-        wxDynamicLibrary dllComCtl32(_T("comctl32.dll") , wxDL_VERBATIM);
+        // see comment in wxApp::GetComCtl32Version() explaining the
+        // use of wxDL_GET_LOADED
+        wxDynamicLibrary dllComCtl32(_T("comctl32.dll"),
+                                     wxDL_VERBATIM |
+                                     wxDL_QUIET |
+                                     wxDL_GET_LOADED);
 
         if ( dllComCtl32.IsLoaded() )
         {
+            wxLogNull noLog;
+
             typedef BOOL (WINAPI *ICCEx_t)(INITCOMMONCONTROLSEX *);
             wxDYNLIB_FUNCTION( ICCEx_t, InitCommonControlsEx, dllComCtl32 );
 
+            dllComCtl32.Detach();
+
             if ( pfnInitCommonControlsEx )
             {
                 s_initResult = (*pfnInitCommonControlsEx)(&icex);