Files
Work/proto/source/factory.hpp
2024-08-07 09:16:27 -04:00

30 lines
742 B
C++

#ifndef _COM_FACTORY_HPP_
#define _COM_FACTORY_HPP_
#ifndef _COMMON_CONSOLE_HPP_
#include <common/console.hpp>
#endif
#ifndef _COM_COM_HPP_
#include <com/com.hpp>
#endif
#ifndef _COM_DLLSERVER_HPP_
#include <com/server.hpp>
#endif
class ClassFactory : public IClassFactory
{
public:
ClassFactory(DLLServer &server,Console &winConsole);
virtual ~ClassFactory();
HRESULT __stdcall QueryInterface(REFIID riid,void **ppv);
ULONG __stdcall AddRef(void);
ULONG __stdcall Release(void);
HRESULT __stdcall CreateInstance(IUnknown *pUnkOuter,REFIID riid,void **ppvObj);
long __stdcall LockServer(int fLock);
protected:
virtual void *createInstance(void)=0;
private:
int mRefCount;
DLLServer &mServer;
Console &mWinConsole;
};
#endif