Welcome to MSDN Blogs Sign in | Join | Help

Sara Ford's Weblog

My adventures embracing open source on CodePlex and at Microsoft

News

    • Did you know... All author proceeds go directly to sending Hurricane Katrina survivors to college.

      Microsoft Visual Studio Tips book

      Recent Entries

Did you know... How to create an Object ID to keep track of your objects? - #314

Whenever you open a DataTip for an instance of an object, you'll see the Make Object ID item in the context menu.

Make Object ID command in DataTip context menu

If you click on Make Object ID, you'll see {1#} get added to the contents of the variable.

str "one" instance made into Object ID #1

and it will also show up in the Watch, Autos or Locals windows.

"one" {1#} as Value in Autos window

Then if you need to look at this object again, you can just refer to its Object ID as shown below in the Watch window.

1# as Name in Watch window

And when you're done looking at the {1#}, you can Delete Object ID from the context menu, either in the Watch (autos or locals) or from the DataTip.

Delete Object ID

Technorati Tags: ,
Posted: Tuesday, September 16, 2008 3:00 AM by saraford

Comments

ejm78 said:

You might want to point out that this feature is not available for VB.  After reading your post, I was so excited to learn of this really cool feature.  The wheels were turning with all the possible uses for it, but when I went to try it out in a VB project, the feature wasn't there.  After some searching, I found a note in MSDN that Object Identity is not available for VB.  MAJOR BUMMER!

# September 16, 2008 5:02 PM
New Comments to this post are disabled
Page view tracker