如何在 .NET 中操作 VB6 集合?
我目前正在为 .NET 软件设计一个接口,该接口将由 COM 对象(特别是 VB6)使用。
虽然我找到了 Microsoft 的许多页面,详细介绍了如何创建 COM 互操作接口,但我目前在设计时对 Collections 的使用感到困惑:我希望能够在.NET 程序 - 这样,我就能够在接口中指定这样的集合作为参数或返回类型,从而简化客户端使用该接口所需的工作。
先感谢您。
编辑:我不打算在“实际工作”.NET 程序中使用 VB6 集合 - 我会尽快转换 VB6 集合并使用正确的 .NET 集合调用其他方法。
I am currently in the process of designing an interface for .NET software that would be consumed by COM objects - specifically, VB6.
While I have found a number of pages by Microsoft detailing how to make an COM-interoperable interface, I am currently tripping over the use of Collections in design time: I would like to be able to use a standard VB6 "Collection object" in the .NET program - that way, I would be able to specify, in the interface, such a collection as an argument, or as a return type, simplifying the work required for clients to use the interface.
Thank you in advance.
Edit: I don't intend to use VB6 collections in the "real work" .NET program - I would convert the VB6 collections as soon as possible and call other methods using proper .NET collections.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您不应使用诸如 集合之类的类型.NET 中 Visual Basic 运行时的对象。
相反,您应该尝试在 System.Collections 命名空间 最适合您的需求。请查看以下文章以获取一些指导:
You shouldn't use a type such as the Collection Object from the Visual Basic Runtime in .NET.
Instead you should try to find an equivalent class in the System.Collections namespace that best suits your needs. Check out the following article for some guidance: