]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/dynlib.tex
fixed indentation in case there's only one cell on line
[wxWidgets.git] / docs / latex / wx / dynlib.tex
CommitLineData
f3845e88
VZ
1%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2%% Name: dynlib.tex
3%% Purpose: wxDynamicLibrary documentation
4%% Author: Vadim Zeitlin
5%% Modified by:
6%% Created: 14.01.02 (extracted from dllload.tex)
7%% RCS-ID: $Id$
8%% Copyright: (c) Vadim Zeitlin
fc2171bd 9%% License: wxWidgets license
f3845e88
VZ
10%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11
12\section{\class{wxDynamicLibrary}}\label{wxdynamiclibrary}
13
14wxDynamicLibrary is a class representing dynamically loadable library
169948a0
VZ
15(Windows DLL, shared library under Unix etc.). Just create an object of
16this class to load a library and don't worry about unloading it -- it will be
17done in the objects destructor automatically.
f3845e88 18
169948a0
VZ
19% deprecated now...
20%
21%\wxheading{See also}
22%
23%\helpref{wxDllLoader}{wxdllloader}
f3845e88 24
f3845e88
VZ
25
26\membersection{wxDynamicLibrary::wxDynamicLibrary}\label{wxdynamiclibrarywxdynamiclibrary}
27
28\func{}{wxDynamicLibrary}{\void}
29
169948a0 30\func{}{wxDynamicLibrary}{\param{const wxString\& }{name}, \param{int }{flags = wxDL\_DEFAULT}}
f3845e88
VZ
31
32Constructor. Second form calls \helpref{Load}{wxdynamiclibraryload}.
33
169948a0
VZ
34\membersection{wxDynamicLibrary::CanonicalizeName}\label{wxdynamiclibrarycanonicalizename}
35
5bb31e35 36\func{wxString}{CanonicalizeName}{\param{const wxString\& }{name}, \param{wxDynamicLibraryCategory}{ cat = wxDL\_LIBRARY}}
169948a0
VZ
37
38Returns the platform-specific full name for the library called \arg{name}. E.g.
39it adds a {\tt ".dll"} extension under Windows and {\tt "lib"} prefix and
40{\tt ".so"}, {\tt ".sl"} or maybe {\tt ".dylib"} extension under Unix.
41
42The possible values for \arg{cat} are:
5bb31e35 43
169948a0
VZ
44\begin{twocollist}
45 \twocolitem{wxDL\_LIBRARY}{normal library}
46 \twocolitem{wxDL\_MODULE}{a loadable module or plugin}
47\end{twocollist}
48
49\wxheading{See also}
50
51\helpref{CanonicalizePluginName}{wxdynamiclibrarycanonicalizepluginname}
52
53
54\membersection{wxDynamicLibrary::CanonicalizePluginName}\label{wxdynamiclibrarycanonicalizepluginname}
55
5bb31e35 56\func{wxString}{CanonicalizePluginName}{\param{const wxString\& }{name}, \param{wxPluginCategory}{ cat = wxDL\_PLUGIN\_GUI}}
169948a0
VZ
57
58This function does the same thing as
fc2171bd 59\helpref{CanonicalizeName}{wxdynamiclibrarycanonicalizename} but for wxWidgets
169948a0
VZ
60plugins. The only difference is that compiler and version information are added
61to the name to ensure that the plugin which is going to be loaded will be
62compatible with the main program.
63
64The possible values for \arg{cat} are:
5bb31e35 65
169948a0
VZ
66\begin{twocollist}
67 \twocolitem{wxDL\_PLUGIN\_GUI}{plugin which uses GUI classes (default)}
68 \twocolitem{wxDL\_PLUGIN\_BASE}{plugin which only uses wxBase}
69\end{twocollist}
70
9ae2ec95
VZ
71\membersection{wxDynamicLibrary::Detach}\label{wxdynamiclibrarydetach}
72
73\func{wxDllType}{Detach}{\void}
74
75Detaches this object from its library handle, i.e. the object will not unload
76the library any longer in its destructor but it is now the callers
169948a0
VZ
77responsability to do this using \helpref{Unload}{wxdynamiclibraryunload}.
78
169948a0
VZ
79\membersection{wxDynamicLibrary::GetSymbol}\label{wxdynamiclibrarygetsymbol}
80
81\constfunc{void*}{GetSymbol}{\param{const wxString\& }{name}}
82
83Returns pointer to symbol {\it name} in the library or NULL if the library
84contains no such symbol.
85
86\wxheading{See also}
87
88\helpref{wxDYNLIB\_FUNCTION}{wxdynlibfunction}
89
f3845e88
VZ
90\membersection{wxDynamicLibrary::IsLoaded}\label{wxdynamiclibraryisloaded}
91
92\constfunc{bool}{IsLoaded}{\void}
93
169948a0
VZ
94Returns \true if the library was successfully loaded, \false otherwise.
95
f3845e88
VZ
96\membersection{wxDynamicLibrary::Load}\label{wxdynamiclibraryload}
97
169948a0 98\func{bool}{Load}{\param{const wxString\& }{name}, \param{int }{flags = wxDL\_DEFAULT}}
f3845e88 99
169948a0
VZ
100Loads DLL with the given \arg{name} into memory. The \arg{flags} argument can
101be a combination of the following bits:
d2c2afc9 102
169948a0
VZ
103\begin{twocollist}
104\twocolitem{wxDL\_LAZY}{equivalent of RTLD\_LAZY under Unix, ignored elsewhere}
105\twocolitem{wxDL\_NOW}{equivalent of RTLD\_NOW under Unix, ignored elsewhere}
106\twocolitem{wxDL\_GLOBAL}{equivalent of RTLD\_GLOBAL under Unix, ignored elsewhere}
107\twocolitem{wxDL\_VERBATIM}{don't try to append the appropriate extension to
108the library name (this is done by default).}
109\end{twocollist}
f3845e88 110
169948a0 111Returns \true if the library was successfully loaded, \false otherwise.
f3845e88 112
169948a0 113\membersection{wxDynamicLibrary::Unload}\label{wxdynamiclibraryunload}
f3845e88 114
169948a0 115\func{void}{Unload}{\void}
f3845e88 116
169948a0 117\func{static void}{Unload}{\param{wxDllType }{handle}}
f3845e88 118
169948a0
VZ
119Unloads the library from memory. wxDynamicLibrary object automatically calls
120this method from its destructor if it had been successfully loaded.
4104ed92 121
169948a0
VZ
122The second version is only used if you need to keep the library in memory
123during a longer period of time than the scope of the wxDynamicLibrary object.
124In this case you may call \helpref{Detach}{wxdynamiclibrarydetach} and store
125the handle somewhere and call this static method later to unload it.
f3845e88 126