RemoteRegistry.h
上传用户:nvosite88
上传日期:2007-01-17
资源大小:4983k
文件大小:3k
源码类别:

VxWorks

开发平台:

C/C++

  1. /* RemoteRegistry.h - DOCM remote registry class */
  2. /* Copyright (c) 2001 Wind River Systems, Inc. */
  3. /*
  4. modification history
  5. --------------------
  6. 01a,07aug01,dsellars  created
  7. */
  8. #ifndef __INCRemoteRegistry_h
  9. #define __INCRemoteRegistry_h
  10. #ifdef __cplusplus
  11. #include "dcomLib.h"
  12. #include "comObjLib.h"
  13. #include "private/comStl.h"
  14. class RemoteRegistry :
  15.     public CComObjectRoot,
  16.     public IRegistry
  17.     {
  18.   public:
  19.     virtual ~RemoteRegistry ();
  20.     RemoteRegistry ();
  21.     // IRegistry implementation...
  22.     HRESULT RegisterClass
  23.         (
  24.         REFCLSID                clsid,
  25.         void *                  pfnGetClassObject
  26.         );
  27.     
  28.     HRESULT IsClassRegistered
  29.         (
  30.         REFCLSID                clsid
  31.         );
  32.     HRESULT CreateInstance
  33.         (
  34.         REFCLSID                clsid,
  35.         IUnknown *              pUnkOuter,
  36.         DWORD                   dwClsContext,
  37.         const char *            hint,
  38.         ULONG                   cMQIs,
  39.         MULTI_QI *              pMQIs
  40.         );
  41.     HRESULT GetClassObject
  42.         (
  43.         REFCLSID                clsid,
  44.         REFIID                  iid,
  45.         DWORD                   dwClsContext,
  46.         const char *            hint,
  47.         IUnknown **             ppClsObj
  48.         );
  49.     HRESULT GetClassID
  50.         (
  51.         DWORD                   dwIndex,
  52.         LPCLSID                 pclsid
  53.         );        
  54.     
  55.     BEGIN_COM_MAP(RemoteRegistry)
  56.         COM_INTERFACE_ENTRY(IRegistry)
  57.     END_COM_MAP()
  58.   private:
  59.     // Not implemented
  60.     RemoteRegistry (const RemoteRegistry& other);
  61.     RemoteRegistry& operator= (const RemoteRegistry& rhs);
  62.     // universal private instance-creation function
  63.     HRESULT instanceCreate
  64.         (
  65.         bool                    classMode,
  66.         REFCLSID                clsid,
  67.         IUnknown *              pUnkOuter,
  68.         DWORD                   dwClsContext,
  69.         const char *            hint,
  70.         ULONG                   cMQIs,
  71.         MULTI_QI *              pMQIs
  72.         );
  73.     // In future, we may want to register specific classes on specific
  74.     // remote servers, however, that functionality is not yet
  75.     // supported, hence the 'entry' class is not really used...
  76.     struct entry
  77.         {
  78.         CLSID   clsid;
  79.         };
  80.     
  81.     typedef STL_MAP(CLSID, entry)       RegMap_t;
  82.     RegMap_t    m_regmap;
  83.     };
  84. typedef CComObject<RemoteRegistry> RemoteRegistryClass;
  85. extern "C" {
  86. #endif
  87. int dcomRemoteRegistryInit (void);
  88. #ifdef __cplusplus
  89. }
  90. #endif
  91. #endif /* __INCRemoteRegistry_h */