Earlier (several days) I was working on a problem of generating a SByte *
from and SByte [].
The initial solution involved:
SByte [] myData = new SByte [2] { 1, 2 };
unsafe
{
fixed(SByte * pMyData = myData)
{
object [] myArgs = new object [1];
.... ???
myType.InvokeMember(myInfo.Name,
BindingFlags.InvokeMethod | ....
null,
myClass,
myArgs);
}
}
Several people got me to here. The problem is that the myArgs is an array
of objects and the SByte * must be converted. However, the type of SByte
does not work with the Reflection.Pointer.Box. The box returns an object as
needed, the 1st argument of the box is the pointer, still ok, however,
because SByte is a non-CLI compliant type, I can not find a form of it to be
used as the type * type (2nd arg of the box call).
Any suggestions?