Do not use AutoDual ClassInterfaceType

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • DKn
    New Member
    • Aug 2007
    • 53

    Do not use AutoDual ClassInterfaceType

    Hello All,

    I am having a C#.Net Windows Control Library Project.. I want to use this control in vb.
    for that i have done like this
    [ProgId("Project Name.MyControl ")]
    [ClassInterface( ClassInterfaceT ype.AutoDual)]
    [Guid("AA5FC4B1-2BF3-4749-9809-84B93D71A62D")]
    public partial class MyControl : UserControl
    {
    ......
    }
    I have done all the steps that required to register this control to make use in vb 6.0. It is working fine in vb 6.0.

    But i am having doubt in [ClassInterface( ClassInterfaceT ype.AutoDual)]
    This msdn link says that Do not use AutoDual ClassInterfaceT ype. we need to go for [ClassInterface( ClassInterfaceT ype.None)]
    http://msdn2.microsoft .com/en-us/library/system.runtime. interopservices .classinterface type.aspx

    At that time we need to do like this..

    [Guid("CAEBF396-B684-4595-9BB0-430C911AD65E")]
    public interface DotNetInterface
    {

    }

    [ProgId("Project Name.MyControl ")]
    [ClassInterface( ClassInterfaceT ype.None)]
    [Guid("AA5FC4B1-2BF3-4749-9809-84B93D71A62D")]
    public partial class MyControl : UserControl, DotNetInterface
    {
    ......
    }

    Here can we use that interface which is not having any method signatures..
    Is there any way to do this without declaring the interface and i need to use
    [ClassInterface( ClassInterfaceT ype.None)], is there any default interface that i can inherit.....Plz can any body clarify this....
Working...