|
-
September 4th, 2009, 12:58 AM
#1
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
-
September 4th, 2009, 02:49 AM
#2
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
Last edited by CCmdTarget; September 4th, 2009 at 02:51 AM.
-
September 4th, 2009, 03:17 AM
#3
Re: ActiveX/COM Event Sink problem
And now I realize the wizard generated classes have their own AttachDispatch().
-
September 4th, 2009, 03:40 AM
#4
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|