C#类的属性是不是在Visual Basic 6.0中可见 [英] properties of c# class is not visible at visual basic 6.0

查看:106
本文介绍了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#程序集的类型libary:

Then use tlbexp.exe to generate a type libary from your C# assembly:

tlbexp ComServer.dll /out:ComServer.tlb

您需要参考从VB6添加到类型库,没有装配。 VB6如何知道你在哪里组装实际上是呢? Regasm是怎么样。这是REGSVR32 .NET程序集是一样的。

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中可见的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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