X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/60431236a330a9f3f1d071719e818812820b4d0c..795c9ab863b2cd2c8839f042162c6e8b921f1734:/src/msw/dlmsw.cpp diff --git a/src/msw/dlmsw.cpp b/src/msw/dlmsw.cpp index cd0d38ae2c..9f904a240c 100644 --- a/src/msw/dlmsw.cpp +++ b/src/msw/dlmsw.cpp @@ -121,8 +121,10 @@ HMODULE wxGetModuleHandle(const char *name, void *addr) return hmod; } - // if failed, try by name - return ::GetModuleHandleA(name); + // Windows CE only has Unicode API, so even we have an ANSI string here, we + // still need to use GetModuleHandleW() there and so do it everywhere to + // avoid #ifdefs -- this code is not performance-critical anyhow... + return ::GetModuleHandle(wxString::FromAscii((char *)name)); } // ============================================================================ @@ -262,7 +264,13 @@ void wxDynamicLibrary::Unload(wxDllType handle) /* static */ void *wxDynamicLibrary::RawGetSymbol(wxDllType handle, const wxString& name) { - return (void *)::GetProcAddress(handle, name.ToAscii()); + return (void *)::GetProcAddress(handle, +#ifdef __WXWINCE__ + name.c_str() +#else + name.ToAscii() +#endif // __WXWINCE__ + ); } // ----------------------------------------------------------------------------