]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/filename.cpp
complain about nonexistent directory in wxDir
[wxWidgets.git] / src / common / filename.cpp
index 086750834279f7e5f1887b43c764ad252f90a038..f8d725c52398a976cce5632c783bbf141feac658 100644 (file)
@@ -1265,19 +1265,17 @@ wxString wxFileName::GetLongPath() const
     if ( !s_triedToLoad )
     {
         s_triedToLoad = TRUE;
-        wxDllType dllKernel = wxDllLoader::LoadLibrary(_T("kernel32"));
-        if ( dllKernel )
+        wxDynamicLibrary dllKernel(_T("kernel32"));
+        if ( dllKernel.IsLoaded() )
         {
             // may succeed or fail depending on the Windows version
             static GET_LONG_PATH_NAME s_pfnGetLongPathName = NULL;
 #ifdef _UNICODE
-            s_pfnGetLongPathName = (GET_LONG_PATH_NAME) wxDllLoader::GetSymbol(dllKernel, _T("GetLongPathNameW"));
+            s_pfnGetLongPathName = (GET_LONG_PATH_NAME) dllKernel.GetSymbol(_T("GetLongPathNameW"));
 #else
-            s_pfnGetLongPathName = (GET_LONG_PATH_NAME) wxDllLoader::GetSymbol(dllKernel, _T("GetLongPathNameA"));
+            s_pfnGetLongPathName = (GET_LONG_PATH_NAME) dllKernel.GetSymbol(_T("GetLongPathNameA"));
 #endif
 
-            wxDllLoader::UnloadLibrary(dllKernel);
-
             if ( s_pfnGetLongPathName )
             {
                 DWORD dwSize = (*s_pfnGetLongPathName)(path, NULL, 0);