views:

85

answers:

2

I have a VB6 dll that is loaded by a VB6 frontend. This VB6 dll calls a C++ ATL dll via its COM interface. So, I can run from code in VB6 and I can debug in C++ also, however I can't seem to step through the VB6 code and then get into the C++ code. I feel that this should be possible. Currently I am doing the following steps

  1. Start VB6 debugging
  2. Start C++ debugging. This involves starting the VB6 front end and setting the working directory to the VB6 front end directory using the VS2008 Debugging Properties in the Options.
  3. Execute the code and step through the VB6 code to the point where I should be entering the C++ code. I see the loaded symbols window changing in the VS2008 IDE.

Now, it looks like it should work, but I never hit any breakpoints in my C++ code. I hit the breakpoints if I don't start the VB6 debugging first.

+5  A: 

You should be able to set vb6.exe as the startup program for your project in C++ and start debugging. Then in VB6, open the project and start debugging.

Kyle Alons
+1, this is the way to do it.
Hans Passant
+1 Should work. VB6.exe is the VB6 IDE in case anyone is wondering. I'm sure there was an article about this in MSDN but can't find it now. @Steve, are you sure you are loading the debug version of your DLL when running from the VB IDE? Also the steps in your question looks a bit odd. I think you should just omit step 1?
MarkJ
Thanks, you're a life saver!
Steve
+1  A: 

Make sure the PDB files for both projects are available for your debugger. If you see . Loaded '\filename', no matching symbolic information found in debug out, you need to add debug symbol search path in tools->optios->debug->symbols.

Sheng Jiang 蒋晟