X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5ef1ba92e664dbd3bb2db2d0b7001370815a9e24..db28c33ca268429840045ef81c17ee1459f4ec47:/src/msw/dlmsw.cpp?ds=sidebyside diff --git a/src/msw/dlmsw.cpp b/src/msw/dlmsw.cpp index 67b52f000a..aebf3e5165 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)); } // ============================================================================ @@ -242,6 +244,15 @@ wxDynamicLibraryDetailsCreator::EnumModulesProc(PSTR name, // wxDynamicLibrary implementation // ============================================================================ +// ---------------------------------------------------------------------------- +// misc functions +// ---------------------------------------------------------------------------- + +wxDllType wxDynamicLibrary::GetProgramHandle() +{ + return (wxDllType)::GetModuleHandle(NULL); +} + // ---------------------------------------------------------------------------- // loading/unloading DLLs // ---------------------------------------------------------------------------- @@ -262,7 +273,13 @@ void wxDynamicLibrary::Unload(wxDllType handle) /* static */ void *wxDynamicLibrary::RawGetSymbol(wxDllType handle, const wxString& name) { - return ::GetProcAddress(handle, name.ToAscii()); + return (void *)::GetProcAddress(handle, +#ifdef __WXWINCE__ + name.c_str() +#else + name.ToAscii() +#endif // __WXWINCE__ + ); } // ----------------------------------------------------------------------------