X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fd6c94288f31c06d4ad3c7d7ab17ed2e32b16b33..f7040b5fe68379e9bc7824aaffa834ae146c4084:/include/wx/dynlib.h diff --git a/include/wx/dynlib.h b/include/wx/dynlib.h index 70287c0b19..1a915ab7dc 100644 --- a/include/wx/dynlib.h +++ b/include/wx/dynlib.h @@ -16,17 +16,15 @@ # pragma interface "dynlib.h" #endif -#include "wx/setup.h" +#include "wx/defs.h" #if wxUSE_DYNLIB_CLASS #include "wx/string.h" #include "wx/dynarray.h" -// FIXME: can this go in private.h or something too?? #if defined(__WXPM__) || defined(__EMX__) -#define INCL_DOS -#include +#include "wx/os2/private.h" #endif #ifdef __WXMSW__ @@ -69,21 +67,18 @@ class WXDLLIMPEXP_BASE wxDynamicLibraryDetailsCreator; enum wxDLFlags { wxDL_LAZY = 0x00000001, // resolve undefined symbols at first use + // (only works on some Unix versions) wxDL_NOW = 0x00000002, // resolve undefined symbols on load + // (default, always the case under Win32) wxDL_GLOBAL = 0x00000004, // export extern symbols to subsequently // loaded libs. - wxDL_VERBATIM = 0x00000008, // Attempt to load the supplied library + wxDL_VERBATIM = 0x00000008, // attempt to load the supplied library // name without appending the usual dll // filename extension. - wxDL_NOSHARE = 0x00000010, // load new DLL, don't reuse already loaded + // (only for wxPluginManager) - // FIXME: why? (VZ) -#ifdef __osf__ - wxDL_DEFAULT = wxDL_LAZY -#else - wxDL_DEFAULT = wxDL_LAZY | wxDL_GLOBAL -#endif + wxDL_DEFAULT = wxDL_NOW // default flags correspond to Win32 }; enum wxDynamicLibraryCategory @@ -250,9 +245,33 @@ public: #endif } +#ifdef __WXMSW__ + // this function is useful for loading functions from the standard Windows + // DLLs: such functions have an 'A' (in ANSI build) or 'W' (in Unicode, or + // wide character build) suffix if they take string parameters + static void *RawGetSymbolAorW(wxDllType handle, const wxString& name) + { + return RawGetSymbol + ( + handle, + name + +#if wxUSE_UNICODE + L'W' +#else + 'A' +#endif + ); + } + + void *GetSymbolAorW(const wxString& name) const + { + return RawGetSymbolAorW(m_handle, name); + } +#endif // __WXMSW__ + // return all modules/shared libraries in the address space of this process // - // returns an empty array if not implemented or an error occured + // returns an empty array if not implemented or an error occurred static wxDynamicLibraryDetailsArray ListLoaded(); // return platform-specific name of dynamic library with proper extension @@ -303,6 +322,8 @@ protected: #if WXWIN_COMPATIBILITY_2_2 && wxUSE_DYNAMIC_LOADER +#include "wx/object.h" + /* wxDllLoader is a class providing an interface similar to unix's dlopen(). It is used by wxDynamicLibrary wxLibrary and manages the actual loading of