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 中不可见
基础教程推荐
- 将事件 TextChanged 分配给表单中的所有文本框 2022-01-01
- 经典 Asp 中的 ResolveUrl/Url.Content 等效项 2022-01-01
- 从 VS 2017 .NET Core 项目的发布目录中排除文件 2022-01-01
- 是否可以在 asp classic 和 asp.net 之间共享会话状态 2022-01-01
- JSON.NET 中基于属性的类型解析 2022-01-01
- 在 VS2010 中的 Post Build 事件中将 bin 文件复制到物 2022-01-01
- 全局 ASAX - 获取服务器名称 2022-01-01
- 首先创建代码,多对多,关联表中的附加字段 2022-01-01
- 如何动态获取文本框中datagridview列的总和 2022-01-01
- 错误“此流不支持搜索操作"在 C# 中 2022-01-01
