]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/dirdlg.cpp
Enable variadic macros for VC9 and later.
[wxWidgets.git] / src / msw / dirdlg.cpp
index cdc10224640e769afd881d6db1eb540dec725d99..d17cdc7f0f159f3e65fb9b43a9bfd17ecdb094c4 100644 (file)
@@ -72,11 +72,15 @@ struct IShellItem : public IUnknown
     virtual HRESULT wxSTDCALL Compare(IShellItem*, DWORD, int*) = 0;
 };
 
     virtual HRESULT wxSTDCALL Compare(IShellItem*, DWORD, int*) = 0;
 };
 
+#endif // #ifndef __IShellItem_INTERFACE_DEFINED__
+
+// Define this GUID in any case, even when __IShellItem_INTERFACE_DEFINED__ is
+// defined in the headers we might still not have it in the actual uuid.lib,
+// this happens with at least VC7 used with its original (i.e. not updated) SDK
+// and there is no harm in defining the GUID unconditionally.
 DEFINE_GUID(IID_IShellItem,
     0x43826D1E, 0xE718, 0x42EE, 0xBC, 0x55, 0xA1, 0xE2, 0x61, 0xC3, 0x7B, 0xFE);
 
 DEFINE_GUID(IID_IShellItem,
     0x43826D1E, 0xE718, 0x42EE, 0xBC, 0x55, 0xA1, 0xE2, 0x61, 0xC3, 0x7B, 0xFE);
 
-#endif // #ifndef __IShellItem_INTERFACE_DEFINED__
-
 struct IShellItemFilter;
 struct IFileDialogEvents;
 
 struct IShellItemFilter;
 struct IFileDialogEvents;
 
@@ -357,21 +361,21 @@ int wxDirDialog::ShowIFileDialog(WXHWND owner)
                                                 REFIID,
                                                 void**);
 
                                                 REFIID,
                                                 void**);
 
-        SHCreateItemFromParsingName_t s_pfnSHCreateItemFromParsingName = NULL;
+        SHCreateItemFromParsingName_t pfnSHCreateItemFromParsingName = NULL;
         wxDynamicLibrary dllShell32;
         if ( dllShell32.Load(wxS("shell32.dll"), wxDL_VERBATIM | wxDL_QUIET) )
         {
         wxDynamicLibrary dllShell32;
         if ( dllShell32.Load(wxS("shell32.dll"), wxDL_VERBATIM | wxDL_QUIET) )
         {
-            wxDL_INIT_FUNC(s_pfn, SHCreateItemFromParsingName, dllShell32);
+            wxDL_INIT_FUNC(pfn, SHCreateItemFromParsingName, dllShell32);
         }
 
         }
 
-        if ( !s_pfnSHCreateItemFromParsingName )
+        if ( !pfnSHCreateItemFromParsingName )
         {
             wxLogLastError(wxS("SHCreateItemFromParsingName() not found"));
             return wxID_NONE;
         }
 
         wxCOMPtr<IShellItem> folder;
         {
             wxLogLastError(wxS("SHCreateItemFromParsingName() not found"));
             return wxID_NONE;
         }
 
         wxCOMPtr<IShellItem> folder;
-        hr = s_pfnSHCreateItemFromParsingName(m_path.wc_str(),
+        hr = pfnSHCreateItemFromParsingName(m_path.wc_str(),
                                               NULL,
                                               wxIID_PPV_ARGS(IShellItem,
                                                              &folder));
                                               NULL,
                                               wxIID_PPV_ARGS(IShellItem,
                                                              &folder));