• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 280
  • Last Modified:

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

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#?
0
Christopher Schene
Asked:
Christopher Schene
  • 2
  • 2
1 Solution
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
To what end?...are you passing the instance to a C/C++ DLL for instance?
0
 
mankowitzCommented:
Are you sure you aren't looking for the handle for the form? me.handle might be what you want.
0
 
Christopher ScheneSystem Engineer/Software EngineerAuthor Commented:
"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.
0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
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~...
0
 
Christopher ScheneSystem Engineer/Software EngineerAuthor Commented:
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
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now