eventcomimpl.h

来自「C++Builder高级应用开发指南随书源码」· C头文件 代码 · 共 62 行

H
62
字号
// EVENTCOMIMPL.H : Declaration of the TEventComImpl

#ifndef EventComImplH
#define EventComImplH

#include "ComDll_TLB.H"


/////////////////////////////////////////////////////////////////////////////
// TEventComImpl     Implements IEventCom, default interface of EventCom
//                  and IEventComEvents, the default source interface
// ThreadingModel : Apartment
// Dual Interface : FALSE
// Event Support  : TRUE
// Default ProgID : ComDll.EventCom
// Description    : 
/////////////////////////////////////////////////////////////////////////////
class ATL_NO_VTABLE TEventComImpl : 
  public CComObjectRootEx<CComSingleThreadModel>,
  public CComCoClass<TEventComImpl, &CLSID_EventCom>,
  public IConnectionPointContainerImpl<TEventComImpl>,
  public TEvents_EventCom<TEventComImpl>, 
  public IEventCom
{
public:
  TEventComImpl()
  {
  }

  // Data used when registering Object 
  //
  DECLARE_THREADING_MODEL(otApartment);
  DECLARE_PROGID("ComDll.EventCom");
  DECLARE_DESCRIPTION("");

  // Function invoked to (un)register object
  //
  static HRESULT WINAPI UpdateRegistry(BOOL bRegister)
  {
    TTypedComServerRegistrarT<TEventComImpl> 
    regObj(GetObjectCLSID(), GetProgID(), GetDescription());
    return regObj.UpdateRegistry(bRegister);
  }


BEGIN_COM_MAP(TEventComImpl)
  COM_INTERFACE_ENTRY(IEventCom)
  COM_INTERFACE_ENTRY_IMPL(IConnectionPointContainer)
END_COM_MAP()

BEGIN_CONNECTION_POINT_MAP(TEventComImpl)
  CONNECTION_POINT_ENTRY(DIID_IEventComEvents)
END_CONNECTION_POINT_MAP()

// IEventCom
public:
 
  STDMETHOD(SetNum(long NumValue));
};

#endif //EventComImplH

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?