Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

properties of c# class is not visible at visual basic 6.0

Tags:

c#

com

vb6

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

like image 752
Partha Avatar asked Sep 05 '25 11:09

Partha


1 Answers

Define a public interface that is also ComVisible, and have your class implement that.

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

tlbexp ComServer.dll /out:ComServer.tlb

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
like image 75
James L Avatar answered Sep 09 '25 17:09

James L