VB.NET in VB6

  • Thread starter Thread starter Thomas Kehl
  • Start date Start date
T

Thomas Kehl

Hello

I have a application written in VB6. Now, Is it possible to use a VB.NET-DLL
in my VB6-Application? - If this works, I can develop new modules in VB.NET
and use this in my app and migrat step by step to VB.NET.

Thanks for your tipps!

Thomas
 
Yes you can ,,,

Create a COM interop component ,,,, i have done this manny times

some tips :

1. you must have a sub new in your to COM exposed class ( the
constructor must be without parameters )
Public Sub New()

MyBase.New()

End Sub

2. provide your own id`s ClassId , InterfaceId and EventsId

register the dll with Regasm instead of regsvr


regards

Michel Posseth [MCP]
 
Thomas Kehl said:
I have a application written in VB6. Now, Is it possible to use a
VB.NET-DLL in my VB6-Application? - If this works, I can develop new
modules in VB.NET and use this in my app and migrat step by step to
VB.NET.

One hint, if you will be using COM and VB 2003 and also have VB 2005
installed:
http://blogs.msdn.com/jmstall/archive/2005/12/05/VS2003_crashes_with_2005.aspx

Might prevent you from looking for the solution hours and hours (like I
did).



Armin
 
Thomas Kehl said:
I have a application written in VB6. Now, Is it possible to use a
VB.NET-DLL in my VB6-Application? - If this works, I can develop new
modules in VB.NET and use this in my app and migrat step by step to
VB.NET.

Yes, that's possible:

..NET Framework Developer's Guide -- Exposing .NET Framework Components to
COM
<URL:http://msdn.microsoft.com/library/en-us/cpguide/html/cpconexposingnetframeworkcomponentstocom.asp>

Visual Basic Language Concepts -- COM Interop
<URL:http://msdn.microsoft.com/library/en-us/vbcn7/html/vaconCOMInteroperability.asp>

<URL:http://msdn.microsoft.com/vbrun/>
 
Back
Top