\twocolitem{wxDL\_VERBATIM}{don't try to append the appropriate extension to
the library name (this is done by default).}
\twocolitem{wxDL\_DEFAULT}{default flags, same as wxDL\_NOW currently}
+\twocolitem{wxDL\_QUIET}{don't log an error message if the library couldn't be
+loaded.}
\end{twocollist}
Returns \true if the library was successfully loaded, \false otherwise.
wxDL_NOSHARE = 0x00000010, // load new DLL, don't reuse already loaded
// (only for wxPluginManager)
+ wxDL_QUIET = 0x00000020, // don't log an error if failed to load
+
wxDL_DEFAULT = wxDL_NOW // default flags correspond to Win32
};
// with "_t" but it doesn't define a variable but just assigns the loaded value
// to it and also allows to pass it the prefix to be used instead of hardcoding
// "pfn" (the prefix can be "m_" or "gs_pfn" or whatever)
+//
+// notice that this function doesn't generate error messages if the symbol
+// couldn't be loaded, the caller should generate the appropriate message
#define wxDL_INIT_FUNC(pfx, name, dynlib) \
- pfx ## name = (name ## _t)(dynlib).GetSymbol(#name)
+ pfx ## name = (name ## _t)(dynlib).RawGetSymbol(#name)
#ifdef __WXMSW__
m_handle = RawLoad(libname, flags);
#endif
- if ( m_handle == 0 )
+ if ( m_handle == 0 && !(flags & wxDL_QUIET) )
{
#ifdef wxHAVE_DYNLIB_ERROR
Error();
{
ms_supportsMultimon = 0;
- wxDynamicLibrary dllUser32(_T("user32.dll"));
-
- wxLogNull noLog;
+ wxDynamicLibrary dllUser32(_T("user32.dll"), wxDL_VERBATIM | wxDL_QUIET);
if ( (wxDL_INIT_FUNC(gs_, MonitorFromPoint, dllUser32)) == NULL ||
(wxDL_INIT_FUNC(gs_, MonitorFromWindow, dllUser32)) == NULL ||
// implementation
EnumDisplayMonitors_t pfnEnumDisplayMonitors;
{
- wxLogNull noLog;
-
- wxDynamicLibrary dllUser32(_T("user32.dll"));
+ wxDynamicLibrary dllUser32(_T("user32.dll"), wxDL_VERBATIM | wxDL_QUIET);
if ( (wxDL_INIT_FUNC(pfn, EnumDisplayMonitors, dllUser32)) == NULL )
return;
}
static ChangeDisplaySettingsEx_t pfnChangeDisplaySettingsEx = NULL;
if ( !pfnChangeDisplaySettingsEx )
{
- wxDynamicLibrary dllUser32(_T("user32.dll"));
+ wxDynamicLibrary dllUser32(_T("user32.dll"), wxDL_VERBATIM | wxDL_QUIET);
if ( dllUser32.IsLoaded() )
{
wxDL_INIT_FUNC_AW(pfn, ChangeDisplaySettingsEx, dllUser32);
if ( !ms_supportsMultimon )
return;
-#if wxUSE_LOG
- // suppress the errors if ddraw.dll is not found, we're prepared to handle
- // this
- wxLogNull noLog;
-#endif
-
- m_dllDDraw.Load(_T("ddraw.dll"));
+ m_dllDDraw.Load(_T("ddraw.dll"), wxDL_VERBATIM | wxDL_QUIET);
if ( !m_dllDDraw.IsLoaded() )
return;
static wxDynamicLibrary s_dllShlwapi;
if ( s_pfnSHAutoComplete == (SHAutoComplete_t)-1 )
{
- wxLogNull noLog;
-
- if ( !s_dllShlwapi.Load(_T("shlwapi.dll"), wxDL_VERBATIM) )
+ if ( !s_dllShlwapi.Load(_T("shlwapi.dll"), wxDL_VERBATIM | wxDL_QUIET) )
{
s_pfnSHAutoComplete = NULL;
}
static bool s_initDone = false;
if ( !s_initDone )
{
- wxLogNull noLog;
-
- wxDynamicLibrary dllUser32(_T("user32.dll"), wxDL_VERBATIM);
+ wxDynamicLibrary dllUser32(_T("user32.dll"), wxDL_VERBATIM | wxDL_QUIET);
wxDL_INIT_FUNC(s_pfn, AnimateWindow, dllUser32);
s_initDone = true;