0
Reply

Exposure of an interface's parent interface to COM

Marco Parreira

Marco Parreira

Dec 12 2006 11:17 AM
1.5k
Suppose you have the following piece of code:

...

[InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
public interface IMyParentInterface
{
     string MyParentString{get;set;}
}

[InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
public interface IMyStringInterface : IMyParentInterface
{
     string MyString{get;set;}
}

[ClassInterface(ClassInterfaceType.None)]
public class MyClass: IMyStringInterface
{
    private string _mystring;
    public string MyString
    {
        get { return _mystring; }
        set { _mystring = value; }
    }

    private string _myparentstring;
    public string MyParentString
    {
        get { return _myparentstring; }
        set { _myparentstring = value; }
    }
}

...


Anyone knows how can we access MyClass.MyParentString from COM?