// headers
// ----------------------------------------------------------------------------
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
- #pragma implementation "fsvolume.h"
-#endif
-
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#if wxUSE_FSVOLUME
+#include "wx/volume.h"
+
#ifndef WX_PRECOMP
#if wxUSE_GUI
#include "wx/icon.h"
#endif
#include "wx/intl.h"
+ #include "wx/hashmap.h"
#endif // WX_PRECOMP
#include "wx/dir.h"
-#include "wx/hashmap.h"
#include "wx/dynlib.h"
#include "wx/arrimpl.cpp"
-#include "wx/volume.h"
-
#include <shellapi.h>
#include <shlobj.h>
#include "wx/msw/missing.h"
// Dynamic library function defs.
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+#if wxUSE_DYNLIB_CLASS
static wxDynamicLibrary s_mprLib;
+#endif
typedef DWORD (WINAPI* WNetOpenEnumPtr)(DWORD, DWORD, DWORD, LPNETRESOURCE, LPHANDLE);
typedef DWORD (WINAPI* WNetEnumResourcePtr)(HANDLE, LPDWORD, LPVOID, LPDWORD);
}
//-----------------------------------------------------------------------
- // The following will most likely will not modify anything not set above,
+ // The following most likely will not modify anything not set above,
// and will not work at all for network shares or empty CD ROM drives.
// But it is a good check if the Win API ever gets better about reporting
// this information.
{
wxString filename(pRes->lpRemoteName);
- if (filename.Len())
+ if (!filename.empty())
{
if (filename.Last() != '\\')
filename.Append('\\');
mounted.Sort(CompareFcn);
// apply list from bottom to top to preserve indexes if removing items.
- int iList = list.GetCount()-1;
- int iMounted;
- for (iMounted = mounted.GetCount()-1; iMounted >= 0 && iList >= 0; iMounted--)
+ ssize_t iList = list.GetCount()-1;
+ for (ssize_t iMounted = mounted.GetCount()-1; iMounted >= 0 && iList >= 0; iMounted--)
{
int compare;
wxString all(list[iList]);
{
::InterlockedExchange(&s_cancelSearch, FALSE); // reset
+#if wxUSE_DYNLIB_CLASS
if (!s_mprLib.IsLoaded() && s_mprLib.Load(_T("mpr.dll")))
{
#ifdef UNICODE
#endif
s_pWNetCloseEnum = (WNetCloseEnumPtr)s_mprLib.GetSymbol(_T("WNetCloseEnum"));
}
+#endif
wxArrayString list;
// Local and mapped drives first.
//-------------------------------
// Allocate the required space for the API call.
- size_t chars = GetLogicalDriveStrings(0, 0);
+ const DWORD chars = GetLogicalDriveStrings(0, NULL);
TCHAR* buf = new TCHAR[chars+1];
// Get the list of drives.
#endif // wxUSE_GUI
#endif // wxUSE_FSVOLUME
-