Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!
I created a simple VB dotNet (VS2005) class library that I called SimpleTest. On the compile tab of the property page, I have checked the Register for COM interop option. Here is the code: <ComClass()> _ Public Class InteropTest Public Function ShowDialog() As Boolean MsgBox("Hello from .Net 2.0!") End Function End Class I then create a simple VB6 ActiveX dll called SimpleVB6. Here is the code: Public Function ShowDialog() As Boolean MsgBox ("Hello from VB6!") End Function I then created a simple VB6 Standard EXE application and set references to both SimpleTest (the dotNet dll) and SimpleVB6 (VB6 dll). I put two command buttons on the form and added the following code: Private Sub Command1_Click() Dim st As SimpleTest.InteropTest Set st = New SimpleTest.InteropTest st.ShowDialog End Sub Private Sub Command2_Click() Dim st As SimpleVB6Test Set st = New SimpleVB6Test st.ShowDialog End Sub
Join the community of 500,000 technology professionals and ask your questions.