如何将.net属性应用于返回类型
-
02-07-2019 - |
题
如何将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();
}
不隶属于 StackOverflow