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

Getting the address of a pointer

P: n/a
I've got a suspicion that two user (and therefore threads) in an ASP.NET
application are sharing the same pointers - which they shouldn't be! The
easiest way for me to possibly debug this is to compare the addresses of the
pointers but VB.NET has lost ObjPtr so this is a bit tricky.

Is there a way to debug the address of a variable/pointers like this?

Thanks, Rob.
Nov 21 '05 #1
Share this Question
Share on Google+
10 Replies


P: n/a
Hi Rob,

Currently I am finding one support professional for you on this issue. When
any update, we will reply here at the first time.

Best Regards,
Wei-Dong XU
Microsoft Product Support Services
This posting is provided "AS IS" with no warranties, and confers no rights.
It is my pleasure to be of assistance.

Nov 21 '05 #2

P: n/a
Rob,

"Rob Nicholson" <in******@community.nospam> schrieb:
I've got a suspicion that two user (and therefore threads) in an ASP.NET
application are sharing the same pointers - which they shouldn't be! The
easiest way for me to possibly debug this is to compare the addresses of
the
pointers but VB.NET has lost ObjPtr so this is a bit tricky.


What pointers are you talking about? Are you dealing with unmanaged code?

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #3

P: n/a
> Currently I am finding one support professional for you on this issue.
When
any update, we will reply here at the first time.


Hi - doesn't matter now thanks. I didn't need to print out the address in
the end - that was just my "old ways" showing whereby looking at hex numbers
to check pointers :-) I was able to simply "?Ptr1 is Ptr2" in the command
window to achieve the same result.

Thanks, Rob.
Nov 21 '05 #4

P: n/a
Hi Rob,

As Herfried said, what do you mean by Ptr?
If you mean the Object reference, in .NET we can use the
Object.ReferenceEquals Method to determines whether the specified Object
instances are the same instance.

If I have any misunderstanding, please feel free to post here.
Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 21 '05 #5

P: n/a
> What pointers are you talking about? Are you dealing with unmanaged code?

The pointers that VB.NET uses all over the place. They might have a new
fancy name, but they are pointers still when it comes down to it :-)

Rob.
Nov 21 '05 #6

P: n/a
> The pointers that VB.NET uses all over the place. They might have a new
fancy name, but they are pointers still when it comes down to it :-)


And before you say, I know they're not really pointers in the C++ sense of
the word, i.e. a 32 bit variable that holds the address of something else,
e.g. an object :-) But they still *work* like pointers/references. I assume
under the hood they are indirect references to the actual object/memory to
allow the garbage collector to move this around behind the scenes.

Cheers, Rob.
Nov 21 '05 #7

P: n/a
Hi

If so I think you means the reference in vb.net.
Did my suggestion help you?

e.g.
Dim o1 as MyClass
Dim o2 as New MyClass
o1 = o2
Object.ReferenceEquals(o1,o2) will be TRUE.
Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 21 '05 #8

P: n/a
> If so I think you means the reference in vb.net.
Did my suggestion help you?


Yes - but is "o1 is o2" then same?

Cheers, Rob.
Nov 21 '05 #9

P: n/a
"Rob Nicholson" <in******@community.nospam> schrieb:
If so I think you means the reference in vb.net.
Did my suggestion help you?


Yes - but is "o1 is o2" then same?


Yes.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Nov 21 '05 #10

P: n/a
Hi Rob,

If you still have any concern for this issue, please feel free to post here.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 21 '05 #11

This discussion thread is closed

Replies have been disabled for this discussion.