Source code of Windows XP (NT5)
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
//+---------------------------------------------------------------------------
//
// Microsoft Windows
// Copyright (C) Microsoft Corporation, 1992 - 1995
//
// File: factory.h
//
// Contents: Definition of the standard class factory class
//
//----------------------------------------------------------------------------
//+---------------------------------------------------------------------------
//
// Class: CStdFactory (csf)
//
// Purpose: Standard implementation of a class factory.
//
//----------------------------------------------------------------------------
class CStdFactory : public IClassFactory { public: typedef HRESULT (FNCREATE)(CMTScript *pMT, IUnknown **ppUnkObj);
CStdFactory(CMTScript *pMT, FNCREATE *pfnCreate); ~CStdFactory() {};
// IUnknown methods
DECLARE_STANDARD_IUNKNOWN(CStdFactory);
// IClassFactory methods
STDMETHOD(CreateInstance)(IUnknown *pUnkOuter, REFIID riid, void ** ppvObject); STDMETHOD(LockServer)(BOOL fLock);
private: CMTScript * _pMT; FNCREATE * _pfnCreate; };
//+---------------------------------------------------------------------------
//
// Struct: REGCLASSDATA
//
// Purpose: Used to declare the classes we want to register with OLE.
// A class factory that will create the class will be registered
// for each entry.
//
//----------------------------------------------------------------------------
struct REGCLASSDATA { const CLSID *pclsid; // CLSID to register
CStdFactory::FNCREATE *pfnCreate; // Pointer to creation function
DWORD ctxCreate; // CLSCTX to register this class with
DWORD dwCookie; // Cookie returned from CoRegister...
};
HRESULT RegisterClassObjects(CMTScript *pMT); void UnregisterClassObjects();
|