Reflection.Pointer.Box

G

Guest

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?
 
G

Guest

Hi Christof,

Thanks for the info, it now compiles, however, you knew that was coming :cool:,
the parameter signature of the class method I am trying to invoke is for a
SByte * but the typeof yields a type of System.Reflection.Pointer. Any new
suggestions?

TNX,

Pat
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top