Marshal generic return types for com interop

Posted by Israel Chen on Stack Overflow See other posts from Stack Overflow or by Israel Chen
Published on 2010-04-08T07:30:08Z Indexed on 2010/04/08 7:33 UTC
Read the original article Hit count: 478

Filed under:
|
|
|

Is it possible to Marshal a generic return type as non-generic for COM interop?

Let's say I have the following class:

[ComVisible(true)]
public class Foo
{
    public IEnumerable GetStr() // Generic return type
    {
        yield break;
    }
}

I know that IEnumerable implements IEnumerable.

Can I force tlbexp.exe (via return: attribute or some other way) to expose GetStr() method as a method returning IEnumerbale?

© Stack Overflow or respective owner

Related posts about .NET

Related posts about com