home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / include / convdllc.h < prev    next >
C/C++ Source or Header  |  1998-04-25  |  1KB  |  55 lines

  1. // --convdllc.h----------------------------------------------------------------
  2. //
  3. // Conversion DLL cache object header file.
  4. //
  5. // Copyright (C) Microsoft Corp., 1986-1996.  All rights reserved.
  6. //
  7. // ----------------------------------------------------------------------------
  8.  
  9. #ifndef _CONVDLLC_H
  10. #define _CONVDLLC_H
  11.  
  12. //$--CDllCache-----------------------------------------------------------------
  13. //
  14. // Object to maintain cache of most frequently used conversion
  15. // DLLs
  16. //
  17. //-----------------------------------------------------------------------------
  18.  
  19. // Constants
  20.  
  21. // maximum number of cached DLLs maintained
  22. const UINT nCachedDlls  =   1024;
  23.  
  24. class CDllCache
  25. {
  26. public:
  27.  
  28.     CDllCache();        // constructor
  29.     ~CDllCache();       // destructor
  30.  
  31.     // Loads the DLL and saves in the cache
  32.     HRESULT HrAdd(
  33.         IN LPWSTR lpwszDllName);    // name of DLL to load and add
  34.  
  35.     // Finds handle of DLL in the cache
  36.     HRESULT HrFind(
  37.         IN LPWSTR lpwszDllName,     // name of DLL to find
  38.         OUT HINSTANCE * phInst);    // pointer to DLL instance handle
  39.  
  40. private:
  41.  
  42.     // structure for cached DLL entries
  43.     struct SDllCache
  44.     {
  45.         WCHAR lpwszName[MAX_PATH + 1];  // DLL name
  46.         HINSTANCE   hInst;      // DLL instance handle
  47.     };
  48.  
  49.     // array of pointers to cached DLLs
  50.     SDllCache * m_rgSDllCache[nCachedDlls];
  51.  
  52. };
  53.  
  54. #endif  // _CONVDLLC_H
  55.