Results 1 to 2 of 2

Thread: [resolved] Making Active X Compatible DLL with C#

  1. #1

    Thread Starter
    Hyperactive Member umilmi81's Avatar
    Join Date
    Sep 2005
    Location
    Sterling Heights, Mi.
    Posts
    335

    Resolved [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 I supposed that would be too obvious.

    I'm using VS2005.
    Last edited by umilmi81; Jun 5th, 2006 at 02:36 PM. Reason: resolved

  2. #2

    Thread Starter
    Hyperactive Member umilmi81's Avatar
    Join Date
    Sep 2005
    Location
    Sterling Heights, Mi.
    Posts
    335

    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
    Attached Images Attached Images  
    Last edited by umilmi81; Jun 5th, 2006 at 02:38 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width