ActiveX/COM Event Sink problem
The ActiveX component I am using successfully calls my event sink.
I get the value:
LPDISPATCH lpDispQuoteValue = V_DISPATCH(&varlValue);
I then try to use the MFC Visual Studio wizard generated class (from typelib).
CQuote quote(lpDispQuoteValue)
If I let it run through debugger normally I get:
First-chance exception at 0x02480183 in ... 0xC0000005: Access violation reading location 0x524b3629.
But, if I step through the code one line at a time it works.
Any idea why?
Thanks
Re: ActiveX/COM Event Sink problem
I didn't figure out why it was happening, but this awesome class saved me from my horrible COM nightmare:
http://www.codeproject.com/KB/COM/co...tchdriver.aspx
xyDispDriver.Attach(lpDispQuoteValue);
pVarResult = xyDispDriver.GetProperty(_T("Symbol"));
pVarResult->bstrVal
Re: ActiveX/COM Event Sink problem
And now I realize the wizard generated classes have their own AttachDispatch().
Re: ActiveX/COM Event Sink problem
Keeping the thread updated in-case someone else has this problem.
I tried the AttachDispatch() method of the VS wizard generated MFC class, but still get the SEH access violation. I passed LPDISPATCH through the constructor the first time. No surprise it did not work because AttachDispatch() should have the same effect.
Interestingly, XYDispDriver uses the same method as the VS generated classes. Both use COleDispatchDriver.
I'm sticking with XYDispDriver. It works great:
http://www.codeproject.com/KB/COM/co...tchdriver.aspx