/////////////////////////////////////////////////////////////////////////////
// TSimpleComImpl Implements ISimpleCom, default interface of SimpleCom
// ThreadingModel : Apartment
// Dual Interface : FALSE
// Event Support : FALSE
// Default ProgID : Project1.SimpleCom
// Description : 第一个COM使用的例程
/////////////////////////////////////////////////////////////////////////////
class ATL_NO_VTABLE TSimpleComImpl :
public CComObjectRootEx<CComSingleThreadModel>,
public CComCoClass<TSimpleComImpl, &CLSID_SimpleCom>,
public ISimpleCom
{
public:
TSimpleComImpl()
{
}
// Data used when registering Object
//
DECLARE_THREADING_MODEL(otApartment);
DECLARE_PROGID("Project1.SimpleCom");
DECLARE_DESCRIPTION("第一个COM使用的例程");
// Function invoked to (un)register object
//
static HRESULT WINAPI UpdateRegistry(BOOL bRegister)
{
TTypedComServerRegistrarT<TSimpleComImpl>
regObj(GetObjectCLSID(), GetProgID(), GetDescription());
return regObj.UpdateRegistry(bRegister);
}