home *** CD-ROM | disk | FTP | other *** search
/ ftp.rarlab.com / 2014.05.ftp.rarlab.com.tar / ftp.rarlab.com / rar / UnrarGUI.zip / DLLMan.cpp next >
C/C++ Source or Header  |  2003-12-21  |  617b  |  31 lines

  1. //---------------------------------------------------------------------------
  2.  
  3. #pragma hdrstop
  4.  
  5. #include "DLLMan.h"
  6.  
  7. //---------------------------------------------------------------------------
  8.  
  9. DLLMan::DLLMan(char *DllName)
  10. {
  11.     Hand = LoadLibrary(DllName);
  12.     if ( !Hand ) {
  13.         throw DLLAbort(AnsiString(DllName)+" missing.");
  14.     }
  15. }
  16.  
  17. void DLLMan::GetProcAddr(FARPROC &Proc, char *ProcName)
  18. {
  19.     Proc = GetProcAddress(Hand, ProcName);
  20.     if ( !Proc ) {
  21.         throw DLLAbort(AnsiString(ProcName)+" no find in DLL.");
  22.     }
  23. }
  24.  
  25. DLLMan::~DLLMan()
  26. {
  27.     FreeLibrary(Hand);
  28. }
  29.  
  30.  
  31.