G
Guest
I am attempting to pass an SByte [] to another .NET class that expects the
data to be passed as SByte *. I searched around and found the boxing can be
used to produce a pointer but I'm not sure if this is appropriate. I am using
the following sequence:
// Load class
Assembly c = Assembl.LoadFrom("filename ....);
// Get the types
cTypes = c.GetTypes();
// Get the appropriate type entry
myType=cTypes[1];
// Get the infos
pInfos = myType.GetMethods();
// Get the appropriate info entry
myInfo=pInfos[0];
// Create a class instance
Object myClass = myType.InvokeMember(null, BindingFlags.CreateInstance ...
// Data to pass
SByte [] myData = new SByte[3] {1,2,3};
// Invoke method
myType.InvokeMember(myInfo.Name,
BindingFlags.InvokeMember ...
null,
myClass,
myData);
However this signature does work nor does
Object [] parms = new Object [1];
parms[0] = myData;
myType.InvokeMember(.....,parms);
Doing:
ParameterInfo[] parmInfo = myInfo.GetParameters [];
shows that parmInfo[0].ParameterType is SByte*
Now how do I get from my SByte [] is SByte *
data to be passed as SByte *. I searched around and found the boxing can be
used to produce a pointer but I'm not sure if this is appropriate. I am using
the following sequence:
// Load class
Assembly c = Assembl.LoadFrom("filename ....);
// Get the types
cTypes = c.GetTypes();
// Get the appropriate type entry
myType=cTypes[1];
// Get the infos
pInfos = myType.GetMethods();
// Get the appropriate info entry
myInfo=pInfos[0];
// Create a class instance
Object myClass = myType.InvokeMember(null, BindingFlags.CreateInstance ...
// Data to pass
SByte [] myData = new SByte[3] {1,2,3};
// Invoke method
myType.InvokeMember(myInfo.Name,
BindingFlags.InvokeMember ...
null,
myClass,
myData);
However this signature does work nor does
Object [] parms = new Object [1];
parms[0] = myData;
myType.InvokeMember(.....,parms);
Doing:
ParameterInfo[] parmInfo = myInfo.GetParameters [];
shows that parmInfo[0].ParameterType is SByte*
Now how do I get from my SByte [] is SByte *