以下のコードの戻り値の型に MarshalAsAttribute を適用するにはどうすればよいですか?
public ISomething Foo()
{
return new MyFoo();
}
以下のコードの戻り値の型に MarshalAsAttribute を適用するにはどうすればよいですか?
public ISomething Foo()
{
return new MyFoo();
}
http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.marshalasattribute.aspxによると:
[return: MarshalAs(<your marshal type>)]
public ISomething Foo()
{
return new MyFoo();
}
[return:MarshalAs]
public ISomething Foo()
{
return new MyFoo();
}