home *** CD-ROM | disk | FTP | other *** search
- /****************************************************************************************
- * Copyright (c) 1999 Microsoft Corporation. All Rights Reserved.
- *
- * File:
- * classfactory.h
- *
- * Description:
- *
- *
- *
- ***************************************************************************************/
- #ifndef __CLASSFACTORY_H__
- #define __CLASSFACTORY_H__
-
-
- #include "RegUtil.h"
- #include "ProfilerCallback.h"
-
-
- //
- // profiler GUID definition
- //
- #define PROFILER_GUID "{01568439-E2BA-4434-8ACC-816239E8B8B5}"
- extern const GUID __declspec( selectany ) CLSID_PROFILER =
- { 0x1568439, 0xe2ba, 0x4434, { 0x8a, 0xcc, 0x81, 0x62, 0x39, 0xe8, 0xb8, 0xb5 } };
-
-
- //
- // Helpers/Registration
- //
- HINSTANCE g_hInst; // instance handle to this piece of code
- const int g_iVersion = 1; // version of coclasses.
-
- static const LPCSTR g_szCoclassDesc = "Microsoft NGWS Profiler";
- static const LPCSTR g_szProgIDPrefix = "Profiler Monitoring Tool";
- static const LPCSTR g_szThreadingModel = "Both";
-
-
- // create a new instance of an object.
- typedef HRESULT (* PFN_CREATE_OBJ)( REFIID riid, void **ppInterface );
-
-
- /***************************************************************************************
- ******************** ********************
- ******************** COCLASS_REGISTER Declaration ********************
- ******************** ********************
- ***************************************************************************************/
- struct COCLASS_REGISTER
- {
- const GUID *pClsid; // Class ID of the coclass
- const char *szProgID; // Prog ID of the class
- PFN_CREATE_OBJ pfnCreateObject; // function to create instance
-
- }; // COCLASS_REGISTER
-
-
- // this map contains the list of coclasses which are exported from this module
- const COCLASS_REGISTER g_CoClasses[] =
- {
- &CLSID_PROFILER,
- PROFILER_GUID,
- ProfilerCallback::CreateObject,
- NULL,
- NULL,
- NULL
- };
-
-
- /***************************************************************************************
- ******************** ********************
- ******************** CClassFactory Declaration ********************
- ******************** ********************
- ***************************************************************************************/
- class CClassFactory :
- public IClassFactory
- {
- private:
-
- CClassFactory();
-
-
- public:
-
- CClassFactory( const COCLASS_REGISTER *pCoClass );
- ~CClassFactory();
-
-
- public:
-
- //
- // IUnknown
- //
- COM_METHOD( ULONG ) AddRef();
- COM_METHOD( ULONG ) Release();
- COM_METHOD( HRESULT ) QueryInterface( REFIID riid, void **ppInterface );
-
- //
- // IClassFactory
- //
- COM_METHOD( HRESULT ) LockServer( BOOL fLock );
- COM_METHOD( HRESULT ) CreateInstance( IUnknown *pUnkOuter,
- REFIID riid,
- void **ppInterface );
-
-
- private:
-
- long m_refCount;
- const COCLASS_REGISTER *m_pCoClass;
-
- }; // CClassFactory
-
-
- //
- // function prototypes
- //
- HINSTANCE GetModuleInst();
- STDAPI DllRegisterServer();
- STDAPI DllUnregisterServer();
- STDAPI DllGetClassObject( REFCLSID rclsid, /* class desired */
- REFIID riid, /* interface desired */
- LPVOID FAR *ppv /* return interface pointer */ );
-
-
- #endif // __CLASSFACTORY_H__
-
- // End of File
-
-
-
-