I am trying to create a COM component using ATL and I would like to raise events for my VB client. I found many tutorials, all of which seem to vary in detail, and none of them create a working solution. That's what I'm doing:
(using Visual Studio 2008):
- Create a new ATL DLL project. I called him
ATLEventTest. - Class view: right-click on
ATLEventTest, a new ATL Simple Object class is added. I named this MyObjectone that generated CMyObject, IMyObjectetc. This object was created using: a) Apartment carving b) Aggregation c) Dual interface d) ISupportErrorInfo e) Connection points
Right click on CProxy_IMyObjectEvents<T>, click "Add Feature"
- The function has a return type void with a name
someEventand accepts int testParam. - Rebuild.
(At this stage, I should see somewhere “We realize the connection point”, I don’t ...) - Right click on
CMyObject. 'Add connection point' - Moved '
_IMyObjectEvents' to list. - Did the code search go through in my solution. Unable to find
someEventanywhere! - Added function
someEvent. Now it is found in ATLEventTest_i.h - Must be able to call
fire_someEvent(...)in my code, but cannot.
. - , , , , ..
" " ++ idl, , : (
Christopher