Sign in to follow this  

COM debugging question

This topic is 3625 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites

This topic is 3625 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this