Types and structs between VB6 and VB.NET interop

samshiell

Member
Joined
Oct 26, 2004
Messages
10
Programming Experience
10+
Hi

I'm working on some interpo between VB6 and VB.NET and I've hit (another?) brick wall.

I need to pass an array of "stuff" between VB6 and VB.NET. This contains an ADO recordset and 4 string values.
There could be any number of these 5 items passed, so they will have to be an array of whatever.

Seemed to me that in VB I should create a Type and in .NET a Struct, then it should be easy. However...

On running the VB app it fails to start with an error "Function or interface marked as restricted, or the function uses automation type not supported in Visual Basic"

VB .NET code is
VB.NET:
Public Structure structComboSetUp
Dim srsData As ADODB.Recordset
Dim sColumnName As String
Dim sDisplayName As String
Dim sBoundColumn As String
Dim sColumnText As String
End Structure
.
.
.
Public WriteOnly Property ComboColumn() As structComboSetUp()        
Set(ByVal value As structComboSetUp())
....

VB6 code is
VB.NET:
Private Type tComboSetup    
tDataSource As Recordset    
tColumnName As String    
tColumnDisplayName As String    
tBoundColumn As String    
tHeaderText As String
End Type
[I]....followed by.... [/I]
DataViewGridControl.ComboColumn = uctComboSetup()

Any ideas?

Thanks

Sam
 
Back
Top