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
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
- How to know full paths to DLL's from .csproj f
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:
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.
Do you apply
ComVisible(true)
to class?As long as you make your class ComVisible in Properties (of Visual Studio 2005 or 2008, or set the ComVisible attribute to True in the Assembly file), you should be able to see your class in VB6. To get intellisense you need to declare an interface, give it a GUID, and implement it as shown in the example code below (Note: you have to create your own unique GUID's for both the interface and the concrete class.