Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Mark Leighton Fisher (4252)

Mark Leighton Fisher
  (email not shown publicly)
http://mark-fisher.home.mindspring.com/

I am a Systems Engineer at Regenstrief Institute [regenstrief.org]. I also own Fisher's Creek Consulting [comcast.net].
Friday February 10, 2006
12:20 PM

Debugging COM Interop: .NET DLL With VB6 .EXE

[ #28647 ]

[Yes, I know it's not Perl but I write my tools in Perl to help with my VB.NET and VB6 development...]

There are two ways to debug a .NET COM Interop DLL used by a VB6 EXE:

  1. Normally, you can use Project -> Properties -> Debug -> Start Action -> Start external program to start VB6.EXE automatically when you click Start Debugging.
     
  2. In Visual Studio 2005 at least, if you have a test project for your DLL in your solution, AND you test that DLL rather than including the DLL sources in the test project (that is, the only source in the test project is for the test code), you will need to explicitly stop at a breakpoint in the VB6 EXE, then attach to that VB6 process with Visual Studio 2005 Tools -> Attach to process. Once you attach to the VB6 EXE, then debugging between the VB6 code and the .NET code is seamless transitioning between managed and unmanaged code will automatically switch debuggers for you. Apparently, the presence of a test project that tests your DLL (as opposed to a test project that includes the source files for your DLL) confuses Visual Studio just enough that when you click Start Debugging, Visual Studio automagically starts the test project for you instead of the external command you specified.

An example Solution where you cannot debug using Start external program:

Project: Joe.dll
    xyz.vb
    abcd.vb
Project: TestJoe
    UnitTest.vb
    [reference: Joe.dll]

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.