[ATL/COM] crashes when starting in release mode

Post questions, comments and feedback to our 3Dconnexion Windows Development Team.

Moderator: Moderators

Post Reply
neobond
Posts: 13
Joined: Wed Jul 04, 2007 4:11 am

[ATL/COM] crashes when starting in release mode

Post by neobond »

Hello,

me again with another Problem driving me to hell!!!!

same framework: see codesnippets here [viewtopic.php?p=4920#4920]

In DEBUG-Mode (VS2005) everything works fine! In Release Mode, the application compiles, but when starting, it crashes when initializing SpaceNavigator...

Code: Select all

*)MedGPU.exe!ATL::CComObject<__Impl__ISimpleDeviceEvents>::CreateInstance()  + 0x7c Bytes	C++
MedGPU.exe!ATL::__ComEventingImpl<SpaceNavigator>::__WhichThis<__Impl__ISimpleDeviceEvents>()  + 0x11b Bytes	C++
MedGPU.exe!ATL::__ComEventingImpl<SpaceNavigator>::__AddHandler<__Impl__ISimpleDeviceEvents>()  + 0x48 Bytes	C++
MedGPU.exe!SpaceNavigator::SpaceNavigator()  + 0x13a Bytes	C++
MedGPU.exe!HardwareManager::HardwareManager()  + 0x5e Bytes	C++
*) This is where it crashes :((

Thanx in advance for your reply
Andi

PS: It would also help me to get pointed to some ATL/COM explanation[/url]
mbonk
Moderator
Moderator
Posts: 181
Joined: Mon Dec 04, 2006 4:06 am

Post by mbonk »

Hi neobond,

How is mPDevice define/declared?

I am inclined to think that the link issue should be sorted first: not that this is a consequence of the link issue.

I tried the atlcubde3d sample changing to using smart pointers and the order in which things are initialized and didn't find any issues.
Perhaps you could set the compiler and linker up to add debugging symbols, probably pdb is best, in the release version and break into it when the crash occurs.

Markus
neobond
Posts: 13
Joined: Wed Jul 04, 2007 4:11 am

Post by neobond »

Hello Markus,

I defined the following Pointers in SpaceNavigator.h:
IUnknownPtr mDevice;
ISimpleDevicePtr mPDevice;
ISensorPtr mP3DSensor;
IKeyboardPtr mP3DKeyboard;
ITDxInfoPtr mP3DInfo;
I also tries using things like CComPtr<...> same result (also concerning the linker problem)

I did compile with adding Debuginformation option, the crash:

Code: Select all

Unhandled exception at 0x004303bc in MedGPU.exe: 0xC0000005: Access violation reading location 0x00000000.
break into crtexe.c

Code: Select all

__tmainCRTStartup(
[...]
ifdef WPRFLAG
            __winitenv = envp;
            mainret = wmain(argc, argv, envp);
#else  /* WPRFLAG */
            __initenv = envp;
            mainret = main(argc, argv, envp);
#endif  /* WPRFLAG */
[...]
and call stack

Code: Select all

MedGPU.exe!ATL::CComObject<__Impl__ISimpleDeviceEvents>::CreateInstance()  + 0x7c bytes	C++
as mentioned??

Regards Andreas[/code]
neobond
Posts: 13
Joined: Wed Jul 04, 2007 4:11 am

Also to mention

Post by neobond »

Maybe related??

in Release Mode I cannot compile using

Code: Select all

[module(name="EventReceiver")];
Anyway

Code: Select all

[module(type=unspecified, name="EventReceiver", uuid="9217D439-8DFE-4C2E-9329-7D95B5FCD5DC")];
works, but not with type=exe,dll...

Same runtime crashing as mentioned above

Greetz
Andreas
Post Reply