home *** CD-ROM | disk | FTP | other *** search
/ PC Format (South-Africa) 2001 June / PCFJune.iso / Xenon / C++ / FreeCommandLineTools.exe / Include / convdllc.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-01-31  |  1.5 KB  |  57 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. #pragma option push -b -a8 -pc -A- /*P_O_Push*/
  11. #define _CONVDLLC_H
  12.  
  13. //$--CDllCache-----------------------------------------------------------------
  14. //
  15. // Object to maintain cache of most frequently used conversion
  16. // DLLs
  17. //
  18. //-----------------------------------------------------------------------------
  19.  
  20. // Constants
  21.  
  22. // maximum number of cached DLLs maintained
  23. const UINT nCachedDlls  =   1024;
  24.  
  25. class CDllCache
  26. {
  27. public:
  28.  
  29.     CDllCache();        // constructor
  30.     ~CDllCache();       // destructor
  31.  
  32.     // Loads the DLL and saves in the cache
  33.     HRESULT HrAdd(
  34.         IN LPWSTR lpwszDllName);    // name of DLL to load and add
  35.  
  36.     // Finds handle of DLL in the cache
  37.     HRESULT HrFind(
  38.         IN LPWSTR lpwszDllName,     // name of DLL to find
  39.         OUT HINSTANCE * phInst);    // pointer to DLL instance handle
  40.  
  41. private:
  42.  
  43.     // structure for cached DLL entries
  44.     struct SDllCache
  45.     {
  46.         WCHAR lpwszName[MAX_PATH + 1];  // DLL name
  47.         HINSTANCE   hInst;      // DLL instance handle
  48.     };
  49.  
  50.     // array of pointers to cached DLLs
  51.     SDllCache * m_rgSDllCache[nCachedDlls];
  52.  
  53. };
  54.  
  55. #pragma option pop /*P_O_Pop*/
  56. #endif  // _CONVDLLC_H
  57.