In Visual Basic 6, create an ActiveX DLL application. Give it a public class with public methods. This are the methods that the Visual Basic .NET application will be able to call.
This example builds a project named VB6Project. It has a public class named MyVB6Class with a public subroutine named VB6SayHi and a public function named VB6ReturnHi.
Compile the project into a DLL.
Next you need to register the DLL. Select the Start menu's Run command and execute the statement:
regsvr32 VB6Project.dll
Next start a Visual Basic .NET project. Select the Project menu's Add Reference command. Click the COM tab and find the DLL or click the Browse button to select it. Now the .NET application can use the DLL's public classes as shown in the following code.
|