Re: ATL Compiler Error When Adding Events
On May 1, 10:26 pm, "Igor Tandetnik" <itandet...@mvps.org> wrote:
<wilme...@gmail.com> wrote in message
I'm really new to the ATL and I running into an issue when trying to
add event capabilities to a ATL component library.
The error that I got is: error C2039: "OnTrigger": is not a member of
Show the code that calls OnTrigger. Was it generated by the wizard? For
a dispinterface, the wizard should have generated a call to
However the Generated file CTIXControl1.h that contains the generated
definition of the interface does not show this method
ICTIXEvents: public IDispatch
This is normal for a dispinterface. Dispinterface methods are not real
methods, they are simply contracts on what DISPIDs are valid for
IDispatch::Invoke call and what parameters should accompany each DISPID.
With best wishes,
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925
Thanks very much Igor,
That is good to know, however the compiler is complaining that the
onTriger() does not exist on that interface.
The offending line is hr = pConnection->OnTrigger( Line, EventType);
which is located in the Fire_onTrigger method from the
CProxyICTIEvents class, and this method was generated by the "add
connection point" wizard from Visual Studio.
HRESULT Fire_OnTrigger( short Line, TxEventTypes EventType)
HRESULT hr = S_OK;
T * pThis = static_cast<T *>(this);
int cConnections = m_vec.GetSize();
for (int iConnection = 0; iConnection < cConnections; iConnection++)
CComPtr<IUnknown> punkConnection = m_vec.GetAt(iConnection);
ICTIXEvents * pConnection = static_cast<ICTIXEvents
hr = pConnection->OnTrigger(Line, EventType); // <-------
I'm really confused now since you said that it is normal for the
dispinterface to be be empty. do you know what could be causing this?