We have created a composite component wrapping a third
party activeX control using ATL. We are using this
component from MFC client.
Component is built as release_min_dependency. MFC Client
in debug mode works like a charm, however, in release mode
it crashes with the errors "Unhandled exception in
MFCClient.exe(CRASHINGIN.DLL):0xC0000005: Access
Violation.".
I have built both client and server with /GZ to make sure
it is not an uniniitialized variable issue in debug mode.
I don't have any ATLASSERTs doing what MFC VERIFY should
be doing.
I presume the cause of this crash is a series of first-
chance exception where the exception pointer is never
reset, eventually crashing. So, I turned the debug info
on, turned off the optimization, and turned the "Stop
always" for the exception: e06d7363("Microsoft C++
Exception"). I get the first exception thrown when I call
CreateControl on the component from the MFC Form View
class. The last steps before exception is as follows:
m_spOleObject->SetClientSite(spClientSite) //called in
AtlhostLic.h
>>MFC takes overfrom here on....
MFC calls COleControl::XOleObject::SetClientSite
and eventually COleDispatchDriver::InvokeHelperV is called
causing AfxThrowOleException(..)
I need to resolve this issue urgently. Any pointers will
be well appreciated.
If you must look at the call stack, here is the dump:
MSVCRT! 7800adef()
MFC42! AfxThrowOleException(long) + 77 bytes
MFC42! COleDispatchDriver::InvokeHelperV(long,unsigned
short,unsigned
short,void *,unsigned char const *,char *) + 496846 bytes
MFC42! COleDispatchDriver::InvokeHelper(long,unsigned
short,unsigned
short,void *,unsigned char const *,...) + 30 bytes
MFC42! COleDispatchDriver::GetProperty(long,unsigned
short,void *) + 22
bytes
MFC42! COleControl::GetAmbientProperty(long,unsigned
short,void *) +
291
bytes
MFC42! COleControl::XOleObject::SetClientSite(struct
IOleClientSite *)
+
103 bytes
ATL::CAxHostWindow::ActivateAx(IUnknown * 0x00c4a6d0,
unsigned char 0,
IStream * 0x00161980) line 2134
ATL::CAxHostWindow::CreateControlEx(ATL::CAxHostWindow *
const
0x05611d18,
const unsigned short * 0x0017a03c, HWND__ * 0x005805cc,
IStream *
0x00161980, IUnknown * * 0x0012ea0c, const _GUID &
{00000000-0000-0000-0000-
000000000000}, IUnknown * 0x00000000) line 1207 + 23 bytes
AtlAxCreateControlEx(const unsigned short * 0x0012ea4c,
HWND__ *
0x005805cc, IStream * 0x00161980, IUnknown * * 0x0012eb1c,
IUnknown * *
0x00000000, const _GUID & {00000000-0000-0000-0000-
000000000000},
IUnknown
* 0x00000000) line 2594 + 57 bytes
AtlAxCreateControl(const unsigned short * 0x0012ea4c,
HWND__ *
0x005805cc,
IStream * 0x00161980, IUnknown * * 0x0012eb1c) line 2578
ATL::AtlAxWindowProc(HWND__ * 0x005805cc, unsigned int 1,
unsigned int
0,
long 1240012) line 2382 + 106 bytes
USER32! 77e148dc()
USER32! 77e163fb()
USER32! 77e280ec()
NTDLL! 77f9f04b()
USER32! 77e2f1cf()
USER32! 77e2a2db()
AtlAxCreateDialogA(HINSTANCE__ * 0x05580000, const char *
0x00000067,
HWND__ * 0x004d05a4, int (HWND__ *, unsigned int, unsigned
int, long)*
0x05598f00
ATL::CDialogImplBaseT<ATL::CWindow>::StartDialogProc
(HWND__
*,
unsigned int, unsigned int, long), long 0) line 2561 + 26
bytes
ATL::CAxDialogImpl<CMainChart,ATL::CWindow>::Create(HWND__
*
0x004d05a4,
long 0) line 2409 + 31 bytes
ATL::CComCompositeControl<CMainChart>::Create(HWND__ *
0x004d05a4,
tagRECT
& {top=0 bottom=359 left=0 right=480}, long 0) line 1439
ATL::CComCompositeControl<CMainChart>::CreateControlWindow
(HWND__ *
0x004d05a4, tagRECT & {top=0 bottom=359 left=0 right=480})
line 1536 +
21
bytes
ATL::CComControlBase::InPlaceActivate(long -5, const
tagRECT *
0x00c387c8
{top=0 bottom=359 left=0 right=480}) line 841 + 18 bytes
ATL::IOleObjectImpl<CMainChart>::DoVerbInPlaceActivate
(const tagRECT *
0x00c387c8 {top=0 bottom=359 left=0 right=480}, HWND__ *
0x004d05a4)
line
1733 + 17 bytes
ATL::IOleObjectImpl<CMainChart>::DoVerb
(ATL::IOleObjectImpl<CMainChart>
*
const 0x05611e94, long -5, tagMSG * 0x00000000 {msg=???
wp=??? lp=???},
tagMSG * 0x00000000 {msg=??? wp=??? lp=???}, tagMSG *
0x00000000
{msg=???
wp=??? lp=???}, HWND__ * 0x004d05a4, const tagRECT *
0x00c387c8 {top=0
bottom=359 left=0 right=480}) line 1806 + 19 bytes
MFC42! COleControlSite::DoVerb(long,struct tagMSG *) + 40
bytes
MFC42! COleControlSite::CreateControl(class CWnd *,struct
_GUID const
&,char const *,unsigned long,struct tagPOINT const
*,struct tagSIZE
const
*,unsigned int,class CFile *,int,unsigned short *) + 388
bytes
MFC42! COleControlContainer::CreateControl(class CWnd
*,struct _GUID
const
&,char const *,unsigned long,struct tagPOINT const
*,struct tagSIZE
const
*,unsigned int,class CFile *,int,unsigned short *,class
COleControlSite
*
*) + 134 bytes
MFC42! CWnd::CreateControl(struct _GUID const &,char const
*,unsigned
long,struct tagPOINT const *,struct tagSIZE const *,class
CWnd
*,unsigned
int,class CFile *,int,unsigned short *) + 63 bytes
MFC42! CWnd::CreateControl(struct _GUID const &,char const
*,unsigned
long,struct tagRECT const &,class CWnd *,unsigned
int,class CFile
*,int,unsigned short *) + 89 bytes
--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: agnic...@geocities.com
MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================
"ukg" <utpalg...@yahoo.com> wrote in message
news:1062e01c129f2$c34de110$a4e62ecf@tkmsftngxa06...
Unfortunately, I can not step into the code, it just shows
me disassembly (my pdb and dlls are matching, that is not
the issue). From ATL::CAxHostWindow::ActiveAx (where the
setclientsite call is originally made) on I can see the
function names in call stack but no code. In release mode
of MFC app, it is all toast at this point, in debug it
continues without breaking ever, just keeps tossing those
first-chance exceptions.
Problem is, control is not handling gracefully, however,
that is deep in COleControl. How can I provide the
ambient property it is looking for, or how can I make it
stop from throwing exception?
>.
>
--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: agnic...@geocities.com
MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================
"ukg" <utpalg...@yahoo.com> wrote in message
news:11a6301c12a98$dbdf88e0$9ee62ecf@tkmsftngxa05...