When I use AfxConnectionAdvise, I receive the error 'undeclared identifier' when compiling. I have included afxwin.h in my file... Does any one know what else I need?
Here is the piece of code.
classB* sinkPtr;
LPUNKNOWN unkSinkPtr;
DWORD dwCookie;
sinkPtr = new classB();
if (sinkPtr)
{
unkSinkPtr = sinkPtr->GetIDispatch(FALSE);
AfxConnectionAdvise(m_ApiPtr, DIID__IApiEvents, unkSinkPtr, FALSE, &dwCookie);
unkSinkPtr->Release;
}
Here is the piece of code.
classB* sinkPtr;
LPUNKNOWN unkSinkPtr;
DWORD dwCookie;
sinkPtr = new classB();
if (sinkPtr)
{
unkSinkPtr = sinkPtr->GetIDispatch(FALSE);
AfxConnectionAdvise(m_ApiPtr, DIID__IApiEvents, unkSinkPtr, FALSE, &dwCookie);
unkSinkPtr->Release;
}