Pregunta

¿Cómo aplico el atributo MarshalAsAttribute al tipo de devolución del código a continuación?

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

Solución

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

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

Otros consejos

[return:MarshalAs]
public ISomething Foo()
{
    return new MyFoo();
}
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top