properties of c# class is not visible at visual basic 6.0(c# 类的属性在 Visual Basic 6.0 中不可见)
问题描述
我在 c# 中创建了一个类,并使 com 可见属性为 true.但是,我在 Visual Basic 6.0 中看不到它的属性.可能是什么问题?请帮帮我
I have created a class in c# and made the com visible property is true. But, i could not see the its properties at visual basic 6.0. what could be a problem? please help me
推荐答案
定义一个也是 ComVisible 的公共接口,并让你的类实现它.
Define a public interface that is also ComVisible, and have your class implement that.
然后使用 tlbexp.exe 从您的 C# 程序集生成类型库:
Then use tlbexp.exe to generate a type libary from your C# assembly:
tlbexp ComServer.dll /out:ComServer.tlb
您需要从 VB6 添加对类型库的引用,而不是程序集.那么VB6如何知道你的程序集实际在哪里呢?Regasm 是怎么回事.它相当于 .net 程序集的 regsvr32.
You need to add a reference to the type library from VB6, not the assembly. How does VB6 know where your assembly actually is then? Regasm is how. It is the equivalent of regsvr32 for .net assemblies.
regasm ComServer.dll
这篇关于c# 类的属性在 Visual Basic 6.0 中不可见的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:c# 类的属性在 Visual Basic 6.0 中不可见


基础教程推荐
- 将 Office 安装到 Windows 容器 (servercore:ltsc2019) 失败,错误代码为 17002 2022-01-01
- c# Math.Sqrt 实现 2022-01-01
- MS Visual Studio .NET 的替代品 2022-01-01
- 为什么Flurl.Http DownloadFileAsync/Http客户端GetAsync需要 2022-09-30
- 将 XML 转换为通用列表 2022-01-01
- 有没有办法忽略 2GB 文件上传的 maxRequestLength 限制? 2022-01-01
- 如何在 IDE 中获取 Xamarin Studio C# 输出? 2022-01-01
- 如何激活MC67中的红灯 2022-01-01
- SSE 浮点算术是否可重现? 2022-01-01
- rabbitmq 的 REST API 2022-01-01