home *** CD-ROM | disk | FTP | other *** search
/ PC Format (South-Africa) 2001 May / PCFMay2001.iso / Xenon / C++ / FreeCommandLineTools.exe / Include / convreg.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-01-31  |  2.7 KB  |  84 lines

  1. // --convreg.h------------------------------------------------------------------
  2. // 
  3. //  Conversion registry class.
  4. //  Locates converters that are stored in DLLs from info stored in the 
  5. //  registry.
  6. //
  7. // Copyright 1986 - 1998 Microsoft Corporation.  All Rights Reserved.
  8. //
  9. // -----------------------------------------------------------------------------
  10.  
  11. #if !defined(_CONVREG_H)
  12. #pragma option push -b -a8 -pc -A- /*P_O_Push*/
  13. #define _CONVREG_H
  14.  
  15. //$$--CEDKConvReg--------------------------------------------------------------
  16. //
  17. //  DESCRIPTION: the conversion registry keeps track of conversion configuration.
  18. //
  19. // ---------------------------------------------------------------------------
  20. class CEDKConvReg
  21. {
  22. public:
  23.  
  24.     CEDKConvReg() ;
  25.     ~CEDKConvReg() ;
  26.  
  27.     HRESULT HrEDKInitialize() ;
  28.  
  29.     HRESULT HrEDKSearchOpen(
  30.         IN LPCWSTR pszConversionPoint,
  31.         IN LPCWSTR pszContentClass,
  32.         OUT CDllEntryPoint * &pep) ;
  33.  
  34.     HRESULT HrEDKSearchNext() ;
  35.  
  36.     void EDKSearchClose() ;
  37.  
  38.     void EDKDumpMappings() ;
  39.  
  40.     // Deletes common member data (static class names list & DLL cache)
  41.     void EDKFree() ;
  42.  
  43.     // function to retrieve a cached DLL handle
  44.     static inline HRESULT CEDKConvReg::HrGetDllHandle(
  45.         IN LPWSTR pszDllName,       // name of DLL to get instance handle for
  46.         OUT HINSTANCE * phInst)     // instance handle pointer
  47.     {
  48.         ASSERTERROR(ms_pDllCache != NULL, "Bad ms_pDllCache");
  49.  
  50.         RETURN(((CDllCache *) CEDKConvReg::ms_pDllCache)->HrFind(pszDllName, phInst));
  51.     }
  52.  
  53. protected:   
  54.     // helper functions
  55.     HRESULT HrEDKParseConfiguration() ;
  56.     HRESULT HrEDKRecordValues(
  57.         IN HKEY const hkEntryPoint, 
  58.         IN LPCWSTR pszDll, 
  59.         IN LPCWSTR pszEntryPoint) ;
  60.     VOID EDKSyntaxError(
  61.         IN LPWSTR pszDll,
  62.         IN LPWSTR pszEntryPoint,
  63.         IN LPWSTR pszClass,
  64.         IN LPWSTR pszOptions,
  65.         IN LPWSTR pszPoint) ;
  66.  
  67.     // common values
  68.     BOOL m_bSyntaxError ;                           // true when a syntax error has occurred.
  69.  
  70.     // common storage
  71.     static HKEY ms_hkConversions ;                  // handle to conversion data in registry
  72.     static CClassName * ms_pcnClasses ;             // in memory cache of conversion data
  73.     static CDllCache * ms_pDllCache;                // DLL instance handle cache
  74.  
  75.     // cursor information
  76.     CDllEntryPoint ** m_ppep ;                      // where to store the entry point pointer
  77.     CClassName * m_pcnCurrentClass ;                // current class.
  78.     LPCWSTR m_pszConversionPoint ;                  // name of conversion point.
  79.     LPCWSTR m_pszContentClass ;                     // name of class
  80. } ;
  81.  
  82. #pragma option pop /*P_O_Pop*/
  83. #endif
  84.