如何将MarshalAsAttribute应用于下面代码的返回类型?

public ISomething Foo()
{
    return new MyFoo();
}
有帮助吗?

解决方案

根据 http://msdn.microsoft。 COM / EN-US /库/ system.runtime.interopservices.marshalasattribute.aspx

[return: MarshalAs(<your marshal type>)]
public ISomething Foo()
{
    return new MyFoo();
}

其他提示

[return:MarshalAs]
public ISomething Foo()
{
    return new MyFoo();
}
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top