I’d like an Interop user control (VB.NET) to return and to accept multiple values from a get/set call. I assumed a user defined type (UDT), would be the correct way but I keep getting a “Variable uses an Automation type not supported in Visual Basic” from the VB6 compile. How is passing multiple values between an interop control and the VB6 application done?
VB.NET (Interop) code, a control with a .NET ListView
Structure Employee
Dim Firstname As String
Dim Lastname As String
End Structure
…
Public Property MyReadListViewData() As Employee
Get
Dim myEmployee As Employee
myEmployee.Lastname = ListView1.SelectedItems(0).Text
Return myEmployee
End Get
Set(ByVal value As Employee)
Me.ListView1.SelectedItems(0).Text = value.Lastname
End Set
End Property
Typical VB6 code:
Private Sub Command4_Click()
Dim myEmployee As Employee
myEmployee = MyToolStrip1.MyReadListViewData
Text3.Text = myEmployee.Lastname
End Sub