#endif
#include "wx/filename.h" // for SplitPath()
+#include "wx/strconv.h"
#include "wx/dynload.h"
#include "wx/module.h"
#endif
}
- m_handle = dlopen(libname.c_str(), rtldFlags);
+ m_handle = dlopen(libname.fn_str(), rtldFlags);
#endif // __VMS || __DARWIN__ ?
#elif defined(HAVE_SHL_LOAD)
{
shlFlags |= BIND_IMMEDIATE;
}
- m_handle = shl_load(libname.c_str(), BIND_DEFERRED, 0);
+ m_handle = shl_load(libname.fn_str(), BIND_DEFERRED, 0);
#elif defined(__WINDOWS__)
m_handle = ::LoadLibrary(libname.c_str());
{
wxString msg(_("Failed to load shared library '%s'"));
#if defined(HAVE_DLERROR) && !defined(__EMX__)
- const wxChar *err = dlerror();
+
+#if wxUSE_UNICODE
+ wxWCharBuffer buffer = wxConvLocal.cMB2WC( dlerror() );
+ const wxChar *err = buffer;
+#else
+ const wxChar *err = dlerror();
+#endif
+
if( err )
wxLogError( msg, err );
#else
DosQueryProcAddr( m_handle, 1L, name.c_str(), (PFN*)symbol );
#elif defined(HAVE_DLOPEN) || defined(__DARWIN__)
- symbol = dlsym( m_handle, name.c_str() );
+ symbol = dlsym( m_handle, name.fn_str() );
#elif defined(HAVE_SHL_LOAD)
- if( shl_findsym( &m_handle, name.c_str(), TYPE_UNDEFINED, &symbol ) != 0 )
+ if( shl_findsym( &m_handle, name.fn_str(), TYPE_UNDEFINED, &symbol ) != 0 )
symbol = 0;
#elif defined(__WINDOWS__)
{
wxString msg(_("wxDynamicLibrary failed to GetSymbol '%s'"));
#if defined(HAVE_DLERROR) && !defined(__EMX__)
+
+#if wxUSE_UNICODE
+ wxWCharBuffer buffer = wxConvLocal.cMB2WC( dlerror() );
+ const wxChar *err = buffer;
+#else
const wxChar *err = dlerror();
+#endif
+
if( err )
{
failed = TRUE;
info = wxClassInfo::sm_first;
while( info->m_next && info->m_next != m_after ) info = info->m_next;
- wxASSERT_MSG( info, _T("ClassInfo from wxPluginLibrary not found on purge"))
+ wxASSERT_MSG( info, _T("ClassInfo from wxPluginLibrary not found on purge"));
info->m_next = m_before;
}
#if WXWIN_COMPATIBILITY_2_2
-wxDllType wxDllLoader::LoadLibrary(const wxString &name)
+wxDllType wxDllLoader::LoadLibrary(const wxString &name, bool *success)
{
wxPluginLibrary *p = wxPluginManager::LoadLibrary
(
wxDL_DEFAULT | wxDL_VERBATIM | wxDL_NOSHARE
);
+ if ( success )
+ *success = p != NULL;
+
return p ? p->GetLibHandle() : 0;
}