How do I get the address of the "me"  object in vb.net?

Posted on 2007-07-29
Medium Priority
Last Modified: 2013-11-26
Hi, I am in a class and I want to get the address of the "me" object class instantiation.

How do I do that? I tried "addressOf me" and the compiler does not seem  to like it

Hiow do I do the same thing in C#?
Question by:Christopher Schene
  • 2
  • 2
LVL 86

Expert Comment

by:Mike Tomlinson
ID: 19589475
To what end?...are you passing the instance to a C/C++ DLL for instance?
LVL 24

Expert Comment

ID: 19589496
Are you sure you aren't looking for the handle for the form? me.handle might be what you want.

Author Comment

by:Christopher Schene
ID: 19589647
"To what end?...are you passing the instance to a C/C++ DLL for instance?"

I am working with multiple instatiations of a given class and I am looking for a way, in my logs files, to distinguish one instatiation from another. I don't really need the address, I suppose, just a way of distinguishing one object from another in the logs.
LVL 86

Accepted Solution

Mike Tomlinson earned 750 total points
ID: 19589843
So setup a "name" field and give each instance a name as you create it.  You can simply increment a counter and add that to the end of ~something~...

Author Comment

by:Christopher Schene
ID: 19751046
They didn't really answer my question and adding the name or id field was something I had already thought of.

I did not realize that addresses are not really meaningful in the CLR, since I think the CLR may actually move the objects around to defragment the memory.

I'll give the points to idle mind

Featured Post


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Loops Section Overview
Suggested Courses
Course of the Month13 days, 23 hours left to enroll

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question