Pergunta

Como posso aplicar o MarshalAsAttribute para o tipo de retorno do código abaixo?

public ISomething Foo()
{
    return new MyFoo();
}
Foi útil?

Solução

De acordo com a http://msdn.microsoft. com / en-us / library / system.runtime.interopservices.marshalasattribute.aspx :

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

Outras dicas

[return:MarshalAs]
public ISomething Foo()
{
    return new MyFoo();
}
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top