[resolved] Making Active X Compatible DLL with C#
Does anyone know how to make a C# DLL reverse compatible with Active X? I want my C# class to be used in VB6. I know it's theoretically possible, but it's not working for me.
I checked the "Register for COM Interop" box in the build properties, but it didn't work :cry: I supposed that would be too obvious. :rolleyes:
I'm using VS2005.
1 Attachment(s)
Re: Making Active X Compatible DLL with C#
I solved this myself.
Steps are as follows:
Include special tag to indicate class interface in front of the class definition
Code:
[ClassInterface(ClassInterfaceType.AutoDual)]
public class YourClassName
{
//Your Code
}
Modify the ComVisible property in the actual assembly file itself
Code:
//Orginally set to false
//[assembly: ComVisible(false)]
[assembly: ComVisible(true)]
Finally, check the "Register for COM Interop" option in the build properties of the project.
Couldn't be easier :sick: