VB6 calls .NET

  • Thread starter Thread starter bears
  • Start date Start date
B

bears

I have two VB6 executables (let's say A and B). A is the
first one start up. After clicking a button on the main
form of A, the executable B will start up by using the
CreateObject() function (to create an object of a class in
B). In this way the main form in B will show. (The
executable I am talking about here is the *.exe file)

After I upgraded the project B to .NET, each time when
clicking on the button in the main form of A, the VB6
version of B is still got called, not the .NET version
one. This is because the registery of B is still for the
VB6 one.

I am not sure how to register the .NET one, so that the
VB6 executable (A) can call up the .NET executable (B).

Also, how to do the debugging? I checked all the
documents, and all just talk about VB6 calls a .NET COM
object or a .NET calls a VB6 COM object. No one talks
about executable call another one.
 
Hi,

You can't call methods or create objects in a .net exe from a vb6 exe.

You can start the .net exe from vb 6 though by using 'shell'.

Cheers
Paul
 
What you're describing should work just fine, AFAIK. I haven't tried it
with VB6 (shudder) but I've got C# objects that I can instantiate just
file from a Delphi EXE.

Make sure that your B project has the right GUIDs defined on its
interfaces and CoClasses (i.e., the same GUIDs that the VB6 version
defined), and that you've set the "Register for COM Interop" option in
Project Properties.
 
Back
Top