473,383 Members | 1,885 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

How to get reference (pointer) to a structure

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
3 6179
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: JKop | last post by:
Does that Standard explicitly forbid the initiation of a null reference? Is there anything wrong with the following code?: void Blah( std::string const &k ) { if ( !&k ) return; // work with...
5
by: Neal Coombes | last post by:
Posted to comp.lang.c++.moderated with little response. Hoping for better from the unmoderated groups: -------- Original Message -------- Subject: Return appropriately by value, (smart)...
1
by: Tobias | last post by:
Hi! I have a problem which is quite tricky. I need to pass a struct from .NET to a native Win32 DLL. But i just need to pass the pointer to a reference of that struct. With my first struct this...
5
by: Kurt Van Campenhout | last post by:
Hi, I am trying to get/set Terminal server information in the active directory on a windows 2000 domain. Since the ADSI calls for TS don't work until W2K3, I need to do it myself. I'm fairly...
12
by: Mike | last post by:
Consider the following code: """ struct person { char *name; int age; }; typedef struct person* StructType;
12
by: Sam Kong | last post by:
Hi, JavaScript hides its memory structure. I know that numbers, booleans, null and undefined are value types (value is directed saved in a variable). I want to know: - How JavaScript...
27
by: Terry | last post by:
I am getting the following warning for the below function. I understand what it means but how do I handle a null reference? Then how do I pass the resulting value? Regards Warning 1...
6
by: lisp9000 | last post by:
I've read that C allows two ways to pass information between functions: o Pass by Value o Pass by Reference I was talking to some C programmers and they told me there is no such thing as...
68
by: Jim Langston | last post by:
I remember there was a thread a while back that was talking about using the return value of a function as a reference where I had thought the reference would become invalidated because it was a...
275
by: Astley Le Jasper | last post by:
Sorry for the numpty question ... How do you find the reference name of an object? So if i have this bob = modulename.objectname() how do i find that the name is 'bob'
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.