VB.NET COLLECTION VB6 COM [英] VB.NET COLLECTION VB6 COM

查看:94
本文介绍了VB.NET COLLECTION VB6 COM的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我正在VB.NET中编写COM类用于VB6项目(厌倦了

VB6的麻烦克隆和序列化对象)。我需要克隆/序列化的所有

类现在都在VB.NET类中,它将这些对象暴露给COM完美。但是我遇到了一个问题,因为这些对象中有些需要一个Collection。当我用一个属性公开VB.NET Collection来编译这个项目时,我得到一个编译时错误

VB无法找到类型库Microsoft .VisualBasic" ;.我甚至尝试使用VBA.CollectionClass来使用
,但每当我尝试在

VB6中创建一个新对象时,该对象保持不变(不会创建)。


Ben Hannon

Williamsport,PA

Hi,

I''m writting a COM Class in VB.NET to be used in a VB6 project (Tired of
the VB6 hassles with cloning and serializing an object). All my
classes I need cloneable/serializable are now in a VB.NET class that exposes
those objects to COM perfectly. However I ran into a problem because some
of these objects requires a Collection. When I compile this project with
the VB.NET Collection exposed for a property, I get a compile time error
that VB cann''t find Type Library "Microsoft.VisualBasic". I even tried
using VBA.CollectionClass, but everytime I try to create a new object in
VB6, the object stays equal to nothing (Doesn''t create).

Ben Hannon
Williamsport, PA

推荐答案

Ben


看看这是否有帮助

http://support.microsoft.com/?kbid=323737


Mattias


-

Mattias Sj?gren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/

请只回复新闻组。
Ben

See if this helps

http://support.microsoft.com/?kbid=323737

Mattias

--
Mattias Sj?gren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/
Please reply only to the newsgroup.


嗨Ben,


我同意Mattias的建议。

问题可能是由于从
$ b $传递集合时的已知问题引起的b .NET连接到Visual Basic 6.0组件的应用程序。


Mattias的链接对你有帮助吗?

如果您有任何相关问题,请随时告诉我。


问候,

Peter Huang

Microsoft在线合作伙伴支持

安全! www.microsoft.com/security

此帖子是提供按原样没有保证,也没有赋予任何权利。

--------------------
Hi Ben,

I agree with Mattias''s suggestion.
The problem may be caused by a known issue when passing a collection from a
.NET-Connected Application to Visual Basic 6.0 Components.

Did Mattias''s link help you?
If you have any related question, please feel free to let me know.

Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
--------------------
来自:Ben Hannon ; < ha **** @ brodart.com>
主题:VB.NET COLLECTION VB6 COM
日期:2003年10月14日星期二09:30:54 -0400
行数:16 < br-> X-Priority:3
X-MSMail-Priority:正常
X-Newsreader:Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE:微软MimeOLE制作V6.00.2800.1165
消息ID:< eQ ************* @ TK2MSFTNGP10.phx.gbl>
新闻组:microsoft.public.dotnet.languages.vb
NNTP-Posting-Host:12.29.184.66
路径:cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP10.phx.gbl
外部参照:cpmsftngxa06.phx.gbl microsoft.public.dotnet。 languages.vb:146549
X-Tomcat-NG:microsoft.public.dotnet.languages.vb



我正在写一个COM类在VB.NET中用于VB6项目(厌倦了VB6与克隆和序列化对象的麻烦)。我需要克隆/可序列化的所有类都在VB.NET类中,
将对象完美地暴露给COM。但是我遇到了一个问题,因为这些对象中的一些需要一个Collection。当我用一个属性暴露的VB.NET集合编译这个项目时,我得到一个编译时错误
VB找不到类型库Microsoft.VisualBasic。我甚至尝试使用VBA.CollectionClass,但每次我尝试在VB6中创建一个新对象时,该对象都保持不变(不会创建)。

Ben Hannon
威廉斯波特,PA
From: "Ben Hannon" <ha****@brodart.com>
Subject: VB.NET COLLECTION VB6 COM
Date: Tue, 14 Oct 2003 09:30:54 -0400
Lines: 16
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <eQ*************@TK2MSFTNGP10.phx.gbl>
Newsgroups: microsoft.public.dotnet.languages.vb
NNTP-Posting-Host: 12.29.184.66
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP10.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vb:146549
X-Tomcat-NG: microsoft.public.dotnet.languages.vb

Hi,

I''m writting a COM Class in VB.NET to be used in a VB6 project (Tired of
the VB6 hassles with cloning and serializing an object). All my
classes I need cloneable/serializable are now in a VB.NET class that exposesthose objects to COM perfectly. However I ran into a problem because some
of these objects requires a Collection. When I compile this project with
the VB.NET Collection exposed for a property, I get a compile time error
that VB cann''t find Type Library "Microsoft.VisualBasic". I even tried
using VBA.CollectionClass, but everytime I try to create a new object in
VB6, the object stays equal to nothing (Doesn''t create).

Ben Hannon
Williamsport, PA






实际上,这些链接帮助我决定杀死尝试通过VBA

收藏,因为我无法序列化它。我决定做的是

使用ArrayList类创建一个VB.NET集合,并公开COM Interop所需的方法

。运行Class

作为控制台应用程序时,一切都很完美(克隆工作正常)。但是,当我将其编译为

DLL并尝试在我的VB6应用程序中使用它时,当我尝试克隆一个对象时,我得到了

错误找不到程序集TartanCls,Version = 1.0.1384.16492,

Culture = neutral,PublicKeyToken = null。有什么想法吗?


Ben Hannon


" Ben Hannon" <公顷**** @ brodart.com>在留言中写道

news:eQ ************* @ TK2MSFTNGP10.phx.gbl ...
Actually, those links helped me decide to kill trying to pass the VBA
Collection since I can''t serialize it. What I decided to do instead is to
create a VB.NET collection with the ArrayList class and expose the methods
needed for COM Interop. Everything works perfectly when running the Class
as a Console App (clone works perfectly). However, when I compile it as a
DLL and try to use it in my VB6 app, when I try to clone an object I get the
error "Cannot find the assembly TartanCls, Version=1.0.1384.16492,
Culture=neutral, PublicKeyToken=null." Any ideas?

Ben Hannon

"Ben Hannon" <ha****@brodart.com> wrote in message
news:eQ*************@TK2MSFTNGP10.phx.gbl...


我正在VB.NET中编写一个用于VB6项目的COM类(厌倦了VB6克隆和序列化对象的麻烦)。我需要克隆/序列化的所有类都在VB.NET类中,
将这些对象完美地暴露给COM。但是我遇到了一个问题,因为这些对象中的一些需要一个Collection。当我用一个属性暴露的VB.NET集合编译这个项目时,我得到一个编译时错误
VB找不到类型库Microsoft.VisualBasic。我甚至尝试使用VBA.CollectionClass,但每次我尝试在VB6中创建一个新对象时,该对象都保持不变(不会创建)。

Ben Hannon
Williamsport,PA
Hi,

I''m writting a COM Class in VB.NET to be used in a VB6 project (Tired of
the VB6 hassles with cloning and serializing an object). All my
classes I need cloneable/serializable are now in a VB.NET class that exposes those objects to COM perfectly. However I ran into a problem because some
of these objects requires a Collection. When I compile this project with
the VB.NET Collection exposed for a property, I get a compile time error
that VB cann''t find Type Library "Microsoft.VisualBasic". I even tried
using VBA.CollectionClass, but everytime I try to create a new object in
VB6, the object stays equal to nothing (Doesn''t create).

Ben Hannon
Williamsport, PA



这篇关于VB.NET COLLECTION VB6 COM的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆