📄 cocomserverimpl.h
字号:
// COCOMSERVERIMPL.H : Declaration of the TCoComServerImpl
#ifndef CoComServerImplH
#define CoComServerImplH
#define ATL_APARTMENT_THREADED
#include "ComServer_TLB.H"
/////////////////////////////////////////////////////////////////////////////
// TCoComServerImpl Implements ICoComServer, default interface of CoComServer
// ThreadingModel : Apartment
// Dual Interface : FALSE
// Event Support : FALSE
// Default ProgID : ComServer.CoComServer
// Description :
/////////////////////////////////////////////////////////////////////////////
class ATL_NO_VTABLE TCoComServerImpl :
public CComObjectRootEx<CComSingleThreadModel>,
public CComCoClass<TCoComServerImpl, &CLSID_CoComServer>,
public ICoComServer
{
public:
long sum;
TCoComServerImpl()
{
sum=0;
}
// Data used when registering Object
//
DECLARE_THREADING_MODEL(otApartment);
DECLARE_PROGID("ComServer.CoComServer");
DECLARE_DESCRIPTION("");
// Function invoked to (un)register object
//
static HRESULT WINAPI UpdateRegistry(BOOL bRegister)
{
TTypedComServerRegistrarT<TCoComServerImpl>
regObj(GetObjectCLSID(), GetProgID(), GetDescription());
return regObj.UpdateRegistry(bRegister);
}
BEGIN_COM_MAP(TCoComServerImpl)
COM_INTERFACE_ENTRY(ICoComServer)
END_COM_MAP()
// ICoComServer
public:
long STDMETHODCALLTYPE Add(long x, long y);
STDMETHOD(get_Value(long* Value));
STDMETHOD(set_Value(long Value));
};
#endif //CoComServerImplH
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -