|
From: andrew7 <bd...@us...> - 2006-12-19 01:49:09
|
Update of /cvsroot/smartwin/SmartWin/include/smartwin In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv11103/include/smartwin Modified Files: LibraryLoader.h Log Message: Support for getProcAddress Index: LibraryLoader.h =================================================================== RCS file: /cvsroot/smartwin/SmartWin/include/smartwin/LibraryLoader.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- LibraryLoader.h 5 May 2006 17:14:37 -0000 1.8 +++ LibraryLoader.h 19 Dec 2006 01:49:06 -0000 1.9 @@ -59,7 +59,7 @@ * "%SYSTEM%/x.dll" and "x.dll" though there probably IS no real difference, this is * a potential "hard to track" bug meaning always instantiate this class with the * EXACT SAME arguments! <br> - * See exempel usage in WidgetRichTextBox + * See example usage in WidgetRichTextBox.h */ class LibraryLoader { @@ -88,6 +88,23 @@ */ void load( const SmartUtil::tstring & libraryName ); + + + /// Get procedure address from loaded library by name + /** Allows you get a procedure address from the dll. + * Example: <br> + * static LibraryLoader richEditLibrary( _T( "riched20.dll" ) ); <br> + * FARPROC x1 = richEditLibrary.getProcAddress( _T("CreateTextServices") ); <br> + * FARPROC x2 = richEditLibrary.getProcAddress( 4 ); <br> + */ + FARPROC getProcAddress( const SmartUtil::tstring & procedureName ); + + /// Get procedure address from loaded library by ordinal value + /** + */ + FARPROC getProcAddress( long procedureOrdinal ); + + /// DTOR freeing up library /** Normally there's not much need of explicitly freeing up a library meaning you * can just allocate your library objects as static objects, also it won't @@ -99,6 +116,7 @@ LibraryLoader( const LibraryLoader & ); // DENY COPY LibraryLoader & operator =( const LibraryLoader & ); // DENY ASSIGNMENT SmartUtil::tstring itsLibraryName; + HMODULE itsHMod; static Utilities::CriticalSection itsCs; static std::map< SmartUtil::tstring, boost::tuple< int, HMODULE > > itsLibrariesLoaded; bool hasCalledLoad; |