I am trying to create a COM component using ATL, and I'd like to raise events for my VB client. I've found numerous tutorials, all of which seem to vary in details, and none of them appear to generate a working solution. Here is what I am doing:
(Using Visual Studio 2008):
- Create a new ATL DLL Project. I've called it
ATLEventTest
. - Class View: Right clicked on
ATLEventTest
, Added a new ATL Simple Object class. I called thisMyObject
, which generatedCMyObject
,IMyObject
, etc... This object was created with: a) Apartment Threading b) Aggregation c) Dual Interface d) ISupportErrorInfo e) Connection points
Right clicked on
CProxy_IMyObjectEvents<T>
, clicked 'Add Function'- Function is of void return type, named
someEvent
, and takes anint testParam
. - Rebuild.
(At this point, I should be able to see an 'Implement Connection Point' somewhere. I do not...) - Right clicked on
CMyObject
. 'Add Connection Point' - Moved '
_IMyObjectEvents
' over into the list. - Did a code search in my solution. Can't find
someEvent
anywhere! - Added the
someEvent
function again. Now, it is found in ATLEventTest_i.h - Should be able to call
fire_someEvent(...)
in my code, but can't.
This has been driving me insane trying to get this to work. If anyone can see what I'm doing wrong, I'd appreciate any corrections, tips, hacks, etc.
At this point, I'm tempted to say screw the wizards, and just try to modify the c++ and idl directly, but I've got a feeling that might not fair much better :(