Events and ATL ActivceX wrapper class

The PDF Creator enables you to create secure PDF documents and to view, print and process existing PDF documents.
If you have any questions about the installation and usage of the PDF Creator please post them here.
Post Reply
ASRoden
Posts: 36
Joined: Thu Jun 15 2006
Location: Auburn, NY USA
Contact:

Events and ATL ActivceX wrapper class

Post by ASRoden »

Has anyone else had to wrap the ActiveX control in an ATL class?
I have this working with the exception of the Event Sink.
Not sure what I am doing wrong.

...
BEGIN_SINK_MAP(CPdfMainWindow)
//Make sure the Event Handlers have __stdcall calling convention
SINK_ENTRY_EX(1, __uuidof(_IPDFCreactiveXEvents),0x00000001, BeforeDelete)
SINK_ENTRY_EX(1, __uuidof(_IPDFCreactiveXEvents),0x00000005, Refresh)
END_SINK_MAP()

// Event Handler for Mouse Move
void __stdcall BeforeDelete(long * Continue)
{
::MessageBox(NULL,"BeforeDelete","TEST",MB_OK);

return S_OK;
}
HRESULT __stdcall Refresh()
{
::MessageBox(NULL,"Refresh","TEST",MB_OK);

return S_OK;
}
...

Any help would be appreciated.
ASRoden
Posts: 36
Joined: Thu Jun 15 2006
Location: Auburn, NY USA
Contact:

Post by ASRoden »

ok for anyone interested, I had the major version of the control wrong in my class specification:

class CPdfMainWindow : public CWindowImpl<CPdfMainWindow, CWindow, CControlWinTraits >,
public IDispEventImpl<1, CPdfMainWindow, &__uuidof(_IPDFCreactiveXEvents), &__uuidof(__ACPDFCREACTIVEX), 2, 0>


was ... , 7, 0> hence my error.

thanks.
Post Reply