Marshalling a Pointer to Array of Struct in C#
In C++, we have a callBack function which is defined as int
GetFunctionTable( FunctionTag **ppFunctionTable )
During initialization, this function gets called and we are to return an
array of FunctionTag into it. Size of array is to be returned by the
return value. In C++, the body would be like
{
static FunctionTag * ourFunctionTable = {{....}, { ...}, ... };
*ppFunctionTable = ourFunctionTable;
}
Most examples that I see on net, I have seen talk about calling a
function. This is a call back function, so memory allocation is ours but
the variable that will accept the return value is fixed.
out IntPtr OR ref IntPtr do not work.
No comments:
Post a Comment