I am writing a COM client prog in MFC / Visual studio 2003. The COM server has an event (callback) interface and a "normal" interface. I have created the class for the "normal" interface thru the class wizard Add Class from the TLB file of the server object. I use this class thru ::CreateDispatch. For the callback interface, I have found that the wizard Add Claas does not create something I could use, so I have created by hand a class, derived from CCmdTarget with automation capabilities. Now the question : How do I use the class wizard to create in that class (with the correct DISPATCH TABLE entries) the callback functions I want to implement from my object ? And how do I instanciate that class ? Thanks for helping me. Franois.
This may help you: http://www.codeproject.com/com/TEventHandler.asp Take a look to the sample app Franois a crit : > I am writing a COM client prog in MFC / Visual studio 2003. > > The COM server has an event (callback) interface and a "normal" interface. > > I have created the class for the "normal" interface thru the class wizard > Add Class from the TLB file of the server object. > I use this class thru ::CreateDispatch. > > For the callback interface, I have found that the wizard Add Claas does not > create something I could use, so I have created by hand a class, derived > from CCmdTarget with automation capabilities. > > Now the question : How do I use the class wizard to create in that class > (with the correct DISPATCH TABLE entries) the callback functions I want to > implement from my object ? > And how do I instanciate that class ? > > Thanks for helping me. > > Franois. > > >
The article is good on COM evnets, but I am really seeking for is as the article says how can I fit an event handler into my code via the wizard. There are some ms KB explaining how to do it by hand (DISP_FUNCTION_IDand so), but I am trying to do it with the wizard. "Mathieu DEGROUX" wrote in message news:eXni2tTFGHA.648@TK2MSFTNGP14.phx.gbl... > This may help you: > http://www.codeproject.com/com/TEventHandler.asp > > Take a look to the sample app > > Franois a crit : > > I am writing a COM client prog in MFC / Visual studio 2003. > > > > The COM server has an event (callback) interface and a "normal" interface. > > > > I have created the class for the "normal" interface thru the class wizard > > Add Class from the TLB file of the server object. > > I use this class thru ::CreateDispatch. > > > > For the callback interface, I have found that the wizard Add Claas does not > > create something I could use, so I have created by hand a class, derived > > from CCmdTarget with automation capabilities. > > > > Now the question : How do I use the class wizard to create in that class > > (with the correct DISPATCH TABLE entries) the callback functions I want to > > implement from my object ? > > And how do I instanciate that class ? > > > > Thanks for helping me. > > > > Franois. > > > > > >