How to Use Net API With VB6
- 1). Create a new Standard EXE VB6 project. A form is created by default with the new project called "Form1." Rename the form to something more meaningful such as "frmMain."
- 2). Select "Project", "References" from the project menu. Click on the check box next to the COM dll file that you would like to access from .NET. Click the "OK" button to close and save.
- 3). Create an object in the code for the load event of "frmMain" that is a reference to the COM.
Dim oNewCOM as DotNetApp.COMFile
Set oNewCOM = New DotNetApp.COMFile
This code creates the object of type "COMFile" and instantiates it. The functions and properties exposed are now available to the VB6 application. - 4). Access any of the exposed functions found in "COMFile" by coding "oNewCom", followed by a period. After typing the period, a list of available functions and properties will be displayed. For example, if one of the functions was called "Version" that returned the version of the "COMFile", you would access that with "oNewCOM.Version."
Source...