“public:virtual long __stdcall PCI1761Event :: GetTypeInfoCount(unsigned int *)”(?GetTypeInfoCount @ PCI1761Event @@ UAGJPAI @ Z)
码
类PCI1761Event:
public CComObjectRoot,
public _IAdvDIOEvents
{
公共:
BEGIN_COM_MAP(PCI1761Event)
COM_INTERFACE_ENTRY(_IAdvDIOEvents)
END_COM_MAP()
PCI1761Event(void);<br>
HRESULT OnDiInterrupt (
long channel,
VARIANT * data,
long scanStart,
long scanCount );<br>
HRESULT OnDiStatusChange (
long port,
VARIANT * data,
long scanStart,
long scanCount );<br>
HRESULT OnDiPatternMatch (
long port,
VARIANT * data,
long scanStart,
long scanCount );<br>
HRESULT OnDeviceRemoved (
long DeviceNumber );
HRESULT STDMETHODCALLTYPE GetTypeInfoCount(
/* [out] */ UINT *pctinfo) ;<br>
HRESULT STDMETHODCALLTYPE GetTypeInfo(
/* [in] */ UINT iTInfo,
/* [in] */ LCID lcid,
/* [out] */ ITypeInfo **ppTInfo) ;
HRESULT STDMETHODCALLTYPE GetIDsOfNames(
/* [in] */ REFIID riid,
/* [size_is][in] */ LPOLESTR *rgszNames,
/* [in] */ UINT cNames,
/* [in] */ LCID lcid,
/* [size_is][out] */ DISPID *rgDispId) ;
/* [local] */ HRESULT STDMETHODCALLTYPE Invoke(
/* [in] */ DISPID dispIdMember,
/* [in] */ REFIID riid,
/* [in] */ LCID lcid,
/* [in] */ WORD wFlags,
/* [out][in] */ DISPPARAMS *pDispParams,
/* [out] */ VARIANT *pVarResult,
/* [out] */ EXCEPINFO *pExcepInfo,
/* [out] */ UINT *puArgErr) ;
公共: 〜PCI1761Event(无效); };
为什么????
答案 0 :(得分:1)
因为您尝试实现的_IAdvDIOEvents
接口来自IDispatch
,因此您必须在类上实现IDispatch
方法。在ATL中,您通常从IDispatchImpl<_IAdvDIOEvents, ...>
类继承您的类,以便为您实现menthod。