COM debugging question

Started by
3 comments, last by iMalc 16 years, 3 months ago
I'm trying to debug some COM code and can't seem to get the program to break where I want to. On the CoCreateInstance line an object is created but I want to step through the creation of this object/class. Whenever I step into the function it just steps over instead. I realise I can't step into the CoCreateFunction but it seems to also bypass the breakpoints I have in the code for the object/class that this function is actually instantiating. hr = CoCreateInstance(clsid, NULL, CLSCTX_LOCAL_SERVER, __uuidof(IDXView), (void **)&m_DxView); I have breakpoints in the IDXView code, well, what I think is the code for it, I've put the breakpoints in the code for cDXView which would be the concrete class for this interface if the company standards have been followed. There is some stuff in an .idl file and I know literally nothing about idl. I'm a complete novice on COM I'm afraid. TIA
---When I'm in command, every mission's a suicide mission!
Advertisement
As long as it is executing the code where the breakpoint is, and the symbols have been loaded for that piece of code, you should hit that breakpoint.
Try deleting the pdb files and doing a rebuild all.

Having said that, I've had the odd problem with not being able to hit breakpoints in release build code. I resorted to temporarily hard coding an __asm {int 3}; into the place I wanted to break. That will definitely work! Otherwise just make sure you're running a debug build.

You could also try spitting out some debug text from that code, to prove it is executing the code you think it is.
"In order to understand recursion, you must first understand recursion."
My website dedicated to sorting algorithms
The reason you wont always hit breakpoints in the release build is that the code is optimized and so might not directly relate to what you've written.
Ok, I'm running the debug build which is what I always run to debug. Do I need to be using the release build? I didn't think you can debug a release build...
---When I'm in command, every mission's a suicide mission!
Quote:Original post by theZapper
Ok, I'm running the debug build which is what I always run to debug. Do I need to be using the release build? I didn't think you can debug a release build...
No, we've both been saying to use the debug build if possible.

Did you try any of the things I mentioned?
"In order to understand recursion, you must first understand recursion."
My website dedicated to sorting algorithms

This topic is closed to new replies.

Advertisement