X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4dc2c3bbc5bc04b6239e14a7ec4e3ddc400a00bc..7c0ea335c7b1aa4ebd8b3a79dfb4be9fb20eefdb:/include/wx/dynlib.h diff --git a/include/wx/dynlib.h b/include/wx/dynlib.h index 68a16fceaf..e6b0bc8c14 100644 --- a/include/wx/dynlib.h +++ b/include/wx/dynlib.h @@ -16,13 +16,13 @@ # pragma interface #endif -#include +#include "wx/setup.h" #if wxUSE_DYNLIB_CLASS -#include -#include -#include +#include "wx/string.h" +#include "wx/list.h" +#include "wx/hash.h" // this is normally done by configure, but I leave it here for now... #if defined(__UNIX__) && !(defined(HAVE_DLOPEN) || defined(HAVE_SHL_LOAD)) @@ -42,15 +42,20 @@ #elif defined(__WINDOWS__) # include typedef HMODULE wxDllType; +#elif defined(__OS2__) +# define INCL_DOS +# include + typedef HMODULE wxDllType; #elif defined(__WXMAC__) typedef CFragConnectionID wxDllType; #else # error "wxLibrary can't be compiled on this platform, sorry." #endif // OS -// defined in windows.h -#ifdef LoadLibrary -# undef LoadLibrary +// LoadLibrary is defined in windows.h as LoadLibraryA, but wxDllLoader method +// should be called LoadLibrary, not LoadLibraryA or LoadLibraryW! +#if defined(__WIN32__) && defined(LoadLibrary) +# include "wx/msw/winundef.h" #endif // ---------------------------------------------------------------------------- @@ -72,7 +77,12 @@ class wxDllLoader @param success Must point to a bool variable which will be set to TRUE or FALSE. @return A handle to the loaded DLL. Use success parameter to test if it is valid. */ - static wxDllType LoadLibrary(const wxString & libname, bool *success); + static wxDllType LoadLibrary(const wxString & libname, bool *success = NULL); + /** This function unloads the shared library. */ + static void UnloadLibrary(wxDllType dll); + /** This function returns a valid handle for the main program + itself. */ + static wxDllType GetProgramHandle(void); /** This function resolves a symbol in a loaded DLL, such as a variable or function name. @param dllHandle Handle of the DLL, as returned by LoadDll().