.\" This is a wxWidgets manpage page generated from the XML docs .TH wxDynamicLibrary 3wx 2005-02-15 "wxWidgets" "wxWidgets class documentation" .SH NAME wxDynamicLibrary \- .SH DESCRIPTION wxDynamicLibrary is a class representing dynamically loadable library (Windows DLL, shared library under Unix etc.). Just create an object of this class to load a library and don't worry about unloading it -- it will be done in the objects destructor automatically. .SH "PARENTS" .SH "INCLUDE FILES" wx/dynlib.h .SH MEMBERS .SS wxDynamicLibrary () .SS wxDynamicLibrary (const wxString& nameint flags = wxDL_DEFAULT) Constructor. Second form calls Load . .SS static wxString CanonicalizeName (const wxString& namewxDynamicLibraryCategory cat = wxDL_LIBRARY) Returns the platform-specific full name for the library called name . E.g. it adds a ".dll" extension under Windows and "lib" prefix and ".so" , ".sl" or maybe ".dylib" extension under Unix. The possible values for cat are: wxDL_LIBRARY normal library wxDL_MODULE a loadable module or plugin .SS static wxString CanonicalizePluginName (const wxString& namewxPluginCategory cat = wxDL_PLUGIN_GUI) This function does the same thing as CanonicalizeName but for wxWidgets plugins. The only difference is that compiler and version information are added to the name to ensure that the plugin which is going to be loaded will be compatible with the main program. The possible values for cat are: wxDL_PLUGIN_GUI plugin which uses GUI classes (default) wxDL_PLUGIN_BASE plugin which only uses wxBase .SS wxDllType Detach () Detaches this object from its library handle, i.e. the object will not unload the library any longer in its destructor but it is now the callers responsibility to do this using Unload . .SS void * GetSymbol (const wxString& name) Returns pointer to symbol name in the library or NULL if the library contains no such symbol. .SS void * GetSymbolAorW (const wxString& name) This function is available only under Windows as it is only useful when dynamically loading symbols from standard Windows DLLs. Such functions have either 'A' (in ANSI build) or 'W' (in Unicode, or wide character build) suffix if they take string parameters. Using this function you can use just the base name of the function and the correct suffix is appende automatically depending on the current build. Otherwise, this method is identical to GetSymbol . .SS static wxDllType GetProgramHandle () Return a valid handle for the main program itself or NULL if symbols from the main program can't be loaded on this platform. .SS bool HasSymbol (const wxString& name) Returns true if the symbol with the given name is present in the dynamic library, false otherwise. Unlike GetSymbol , this function doesn't log an error message if the symbol is not found. \newsince{2.5.4} .SS bool IsLoaded () Returns true if the library was successfully loaded, false otherwise. .SS static wxDynamicLibraryDetailsArray ListLoaded () This static method returns an array containing the details of all modules loaded into the address space of the current project, the array elements are object of wxDynamicLibraryDetails class. The array will be empty if an error occurred. This method is currently implemented only under Win32 and Linux and is useful mostly for diagnostics purposes. .SS bool Load (const wxString& nameint flags = wxDL_DEFAULT) Loads DLL with the given name into memory. The flags argument can be a combination of the following bits: wxDL_LAZY equivalent of RTLD_LAZY under Unix, ignored elsewhere wxDL_NOW equivalent of RTLD_NOW under Unix, ignored elsewhere wxDL_GLOBAL equivalent of RTLD_GLOBAL under Unix, ignored elsewhere wxDL_VERBATIM don't try to append the appropriate extension to the library name (this is done by default). wxDL_DEFAULT default flags, same as wxDL_NOW currently Returns true if the library was successfully loaded, false otherwise. .SS void Unload () .SS static void Unload (wxDllType handle) Unloads the library from memory. wxDynamicLibrary object automatically calls this method from its destructor if it had been successfully loaded. The second version is only used if you need to keep the library in memory during a longer period of time than the scope of the wxDynamicLibrary object. In this case you may call Detach and store the handle somewhere and call this static method later to unload it. .SH "SEE ALSO" .SH "AUTHORS" Documentation content by Julian Smart, Robert Roebling, Vadim Zeitlin, Robin Dunn, et al Conversion to manpage format by Arnout Engelen (http://bzzt.net), bugreports welcome.