How to get reference (pointer) to a structure

T

tomi

Help please

Ho can I write following (from C#) thing in VB.NET ?

IntPtr pointer = new IntPtr(&mode)

mode is a instance of some structure.
I cannot find any solution. I need to pass the pointer to a structure
to COM+ object Thanks

Tomas
 
M

Mick Walker

tomi said:
Help please

Ho can I write following (from C#) thing in VB.NET ?

IntPtr pointer = new IntPtr(&mode)

mode is a instance of some structure.
I cannot find any solution. I need to pass the pointer to a structure
to COM+ object Thanks

Tomas
Aren't pointer operations unsafe in C#?
 
T

Tom Shelton

Help please

Ho can I write following (from C#) thing in VB.NET ?

IntPtr pointer = new IntPtr(&mode)

mode is a instance of some structure.
I cannot find any solution. I need to pass the pointer to a structure
to COM+ object Thanks

Tomas

Usually, it would just make the VB.NET signature as ByRef. So, it
would be:

Dim mode As TheMode
....

theFunction (mode)

I'm not exactly sure why they are doing that in C# either. You're
going to have to be a little more explicit.
 

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