00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef KEOS_DYNLIB_H
00023 #define KEOS_DYNLIB_H
00024
00025 #include "KeosPrerequisites.h"
00026
00027 #if KEOS_PLATFORM == KEOS_PLATFORM_WIN32
00028 # define DYNLIB_HANDLE hInstance
00029 # define DYNLIB_LOAD( a ) LoadLibrary( a )
00030 # define DYNLIB_GETSYM( a, b ) GetProcAddress( a, b )
00031 # define DYNLIB_UNLOAD( a ) !FreeLibrary( a )
00032
00033 struct HINSTANCE__;
00034 typedef struct HINSTANCE__* hInstance;
00035 #endif
00036
00037 namespace Keos
00038 {
00039
00044 class KEOS_EXPORT CDynLib
00045 {
00046 protected:
00048 String m_strName;
00049
00053 String DynlibError( void ) ;
00054
00055 public:
00060 CDynLib( const String& strName );
00061
00064 ~CDynLib();
00065
00068 void Load();
00069
00072 void Unload();
00073
00077 const String& GetName(void) const
00078 {
00079 return m_strName;
00080 }
00081
00088 void* GetSymbol( const String& strName ) const throw();
00089
00090 protected:
00091
00093 DYNLIB_HANDLE m_hInst;
00094 };
00095 }
00096
00097 #endif // KEOS_DYNLIB_H