1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Dynamic library management
4 // Author: Guilhem Lavaux
8 // Copyright: (c) Guilhem Lavaux
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_DYNLIB_H__
13 #define _WX_DYNLIB_H__
19 #include <wx/string.h>
23 #if defined(HAVE_DLOPEN)
26 typedef void *wxDllType
;
27 #elif defined(HAVE_SHLLOAD)
30 typedef void *wxDllType
;
31 #elif defined(__WINDOWS__)
34 typedef HMODULE wxDllType
;
35 #elif defined(__WXMAC__)
36 typedef CFragConnectionID wxDllType
;
38 #error "wxLibrary can't be compiled on this platform, sorry."
41 // defined in windows.h
46 // ----------------------------------------------------------------------------
48 // ----------------------------------------------------------------------------
50 class wxLibrary
: public wxObject
53 wxHashTable classTable
;
56 wxLibrary(void *handle
);
59 // Get a symbol from the dynamic library
60 void *GetSymbol(const wxString
& symbname
);
62 // Create the object whose classname is "name"
63 wxObject
*CreateObject(const wxString
& name
);
66 void PrepareClasses(wxClassInfo
*first
);
71 // ----------------------------------------------------------------------------
73 // ----------------------------------------------------------------------------
81 // caller is responsible for deleting the returned pointer if !NULL
82 wxLibrary
*LoadLibrary(const wxString
& basename
);
84 wxObject
*CreateObject(const wxString
& name
);
90 // ----------------------------------------------------------------------------
92 // ----------------------------------------------------------------------------
94 extern wxLibraries wxTheLibraries
;
96 // ----------------------------------------------------------------------------
97 // Interesting defines
98 // ----------------------------------------------------------------------------
100 #define WXDLL_ENTRY_FUNCTION() \
101 extern "C" wxClassInfo *wxGetClassFirst(); \
102 wxClassInfo *wxGetClassFirst() { \
103 return wxClassInfo::GetFirst(); \
106 #endif // _WX_DYNLIB_H__