By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,400 Members | 1,335 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,400 IT Pros & Developers. It's quick & easy.

How to get reference (pointer) to a structure

P: n/a
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

Oct 21 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
tomi wrote:
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#?
Oct 21 '07 #2

P: n/a
Dim pointer As New IntPtr(AddressOf mode)
"tomi" wrote:
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

Oct 21 '07 #3

P: n/a
On Oct 21, 10:07 am, tomi <tomi.tres...@gmail.comwrote:
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.
--
Tom Shelton

Oct 21 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.