通过“混合数组"从VB6到VB.NET

编程入门 行业动态 更新时间:2024-10-28 16:21:55
本文介绍了通过“混合数组"从VB6到VB.NET的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

嗨 我需要在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

推荐答案

您可以尝试用byRef代替byVal You might try byRef instead of byVal

感谢您的想法,但不,在这种情况下,ByRef并非如此.合法... Thanks for the thought but no, ByRef in that context isn''t legal...

更多推荐

通过“混合数组"从VB6到VB.NET

本文发布于:2023-05-29 15:08:51,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/347298.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:数组   quot   VB   NET

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!