如何申请的MarshalAsAttribute以低于code中的返回类型?
公共ISomething富()
{
返回新MyFoo();
}
解决方案
据http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.marshalasattribute.aspx:
[返回:的MarshalAs(<您的名帅型>)
公共ISomething美孚()
{
返回新MyFoo();
}
How do I apply the MarshalAsAttribute to the return type of the code below?
public ISomething Foo()
{
return new MyFoo();
}
解决方案
According to http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.marshalasattribute.aspx:
[return: MarshalAs(<your marshal type>)]
public ISomething Foo()
{
return new MyFoo();
}
上一篇:是#地区的指令在.NET真的有用吗?指令、有用吗、地区、NET
下一篇:学习单C#