473,471 Members | 1,814 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Reflection.Pointer.Box

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?
Nov 17 '05 #1
2 3603
Did you try:
Pointer.Box(pMyData, typeof(sbyte*))
Nov 17 '05 #2
Hi Christof,

Thanks for the info, it now compiles, however, you knew that was coming 8-),
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

"Christof Nordiek" wrote:
Did you try:
Pointer.Box(pMyData, typeof(sbyte*))

Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: ichor | last post by:
hi i have read a few examples that use the System.Reflection api , but i cant understand in what way is it helpful. i mean its practical use in the real world thanx
10
by: Sunny | last post by:
Hi, I have an old problem which I couldn't solve so far. Now I have found a post in that group that gave me an idea, but I can not fully understand it. The problem is: I'm trying to use a...
2
by: Ingo Nolden | last post by:
Hi, I want to call the constructor of a managed class by reflection. This is not problem so far. I have the instance of ConstructorInfo, that belongs to the constructor I want to call. But the...
0
by: MWells | last post by:
I have a simple VS.NET solution with Project "A" as a web app and Project "B" as a class library. "B" does some HTML rendering, and uses reflection to locate and load the necessary rendering...
6
by: Simon Verona | last post by:
I would normally use code such as : Dim Customer as new Customer Dim t as new threading.thread(AddressOf Customer.DisplayCustomer) Customer.CustomerId=MyCustomerId t.start Which would create...
0
by: Shawn Hogan | last post by:
Hi everyone, I've been trying to execute a control's private event code via reflection from another class with the goal of potentially doing some unit testing. The examples below are trying to...
2
by: greg.corson | last post by:
Hi, I'm in the process of building a complex system using a sort of "system services" model. I'm looking at putting together various services like serialization, networking, 2D/3D rendering,...
2
by: diego | last post by:
hi everyone, i have a sub that opens a form given the form's name as string and opens it using System.Reflection. How can I set the form's properties at runtime. Here is my code. Public Sub...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.