home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 2001 January / VPR0101A.BIN / OLS / TAR32053 / tar32053.exe / SRC / BZ2DLL.C < prev    next >
C/C++ Source or Header  |  1999-05-23  |  1KB  |  40 lines

  1. #include "bz2dll.h"
  2. #include <windows.h>
  3.  
  4. static int BZ2DLLLoaded = 0;
  5. static HINSTANCE BZ2DLLhLib;
  6.  
  7. int BZ2DLLLoadLibrary(void)
  8. {
  9.     HINSTANCE hLib;
  10.  
  11.     if(BZ2DLLLoaded==1){return 0;}
  12.     hLib=LoadLibrary("BZ2LIB.DLL");
  13.     if(hLib == NULL){
  14.         MessageBox(NULL,"Can't load BZ2LIB.DLL","Error",MB_ICONEXCLAMATION);
  15.         return -1;
  16.     }
  17.     BZ2DLLLoaded=1;
  18.     BZ2DLLhLib=hLib;
  19.     BZ2GetVersion=GetProcAddress(hLib,"BZ2GetVersion");
  20.     BZ2GetRunning=GetProcAddress(hLib,"BZ2GetRunning");
  21.     BZ2GetLevelStream=GetProcAddress(hLib,"BZ2GetLevelStream");
  22.     BZ2GetLevel=GetProcAddress(hLib,"BZ2GetLevel");
  23.     /*BZ2OpenStream=GetProcAddress(hLib,"BZ2OpenStream");*/
  24.     BZ2Open=GetProcAddress(hLib,"BZ2Open");
  25.     /*BZ2CloseStream=GetProcAddress(hLib,"BZ2CloseStream");*/
  26.     BZ2Close=GetProcAddress(hLib,"BZ2Close");
  27.     BZ2Write=GetProcAddress(hLib,"BZ2Write");
  28.     BZ2Read=GetProcAddress(hLib,"BZ2Read");
  29.     return 0;
  30.  
  31. }
  32. int BZ2DLLFreeLibrary(void)
  33. {
  34.     if(BZ2DLLLoaded==0){return 0;}
  35.     FreeLibrary(BZ2DLLhLib);
  36.     BZ2DLLLoaded=0;
  37. }
  38.  
  39.  
  40.