I have a COM library I have imported into C# and it needs a function to be called with a ref variable and I'm unable to figure out how to declare a variable that the compiler will accept.
I have looked into the generated c# interface code and tried a collection of other declarations, none of which have worked.
The function I need to call is declared in the c# import file as
[DispId(1610809355)]
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
bool brReadnext([MarshalAs(UnmanagedType.Struct), In, Out, Optional] ref object sItemId);
The same call was being used in Delphi as was declaring an OleVariant if that helps.
Just cant get it to be accepted by the compiler.
I have seen this post Marshaling Delphi 5 OleVariant to C# but it's not helped.