问题描述
嗨
我需要在VB6和VB.NET之间传递一个东西"数组.它包含一个ADO记录集和3个字符串值.这4个项目可以传递任意数量,因此它们必须是任何数组.
在我看来,在VB中我应该创建一个Type,在.NET中是Struct,那么它应该很容易.但是...
在运行VB应用程序时,它无法启动并显示错误功能或接口标记为受限,或者该功能使用了Visual Basic不支持的自动化类型"
VB .NET代码为
Hi
I need to pass an array of "stuff" between VB6 and VB.NET. This contains an ADO recordset and 3 string values. There could be any number of these 4 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 runniung 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
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代码为
VB6 code is
Private Type tComboSetup
tDataSource As Recordset
tColumnName As String
tColumnDisplayName As String
tBoundColumn As String
tHeaderText As String
End Type
<br>
....followed by....
<br>
DataViewGridControl.ComboColumn = uctComboSetup()
有什么想法吗?
干杯
Sam
Any ideas?
Cheers
Sam
推荐答案
这篇关于通过“混合数组"从VB6到VB.NET的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!