
Untitled
By: a guest on
Aug 7th, 2012 | syntax:
None | size: 0.75 KB | hits: 11 | expires: Never
What is the syntax for an interface method when using MarshalAs
public interface IMine
{
[DispId(1)]
object stringSize(string txt, string fontName, float fontSize)
{
[return: MarshalAs(UnmanagedType.Struct, SafeArraySubType = VarEnum.VT_ARRAY)]
}
}
The name 'MarshalAs' does not exist in the current context
public object stringSize(string txt, string fontName, float fontSize)
{
System.Drawing.SizeF result = _textSize(txt, fontName, fontSize);
return new object[] { result.Width, result.Height };
}
public interface IMine
{
[DispId(1)]
[return: MarshalAs(UnmanagedType.Struct, SafeArraySubType = VarEnum.VT_ARRAY)]
object stringSize(string txt, string fontName, float fontSize)
{
// stuff...
}
}