GetValue

  • Thread starter Thread starter Cezar
  • Start date Start date
C

Cezar

Hi,

For non static fields, FieldInfo's GetValue needs an instance of a class
that inherits or declares the field.
What I do is that I create an instance of the class that defines the field
using
Object instObj = Activator.CreateInstance(cl);

but now I need to get the value of the field from the current instance of
the class in the "already running" application.
Kind of what the debugger does when it shows the values
for fields, params etc as it runs the application.

I looked at RuntimeFieldHandle. GetHashCode returns the code of an
instance. Can I use this to find the running instance or I'm looking
in the wrong direction?

Any idea how can I get the class'/method/field current instance
(suppose that the application is already running)

I hope it makes sense what I said...

Thank you
Cezar
 
I looked at RuntimeFieldHandle. GetHashCode returns the code of an
instance. Can I use this to find the running instance

No you can't.

Any idea how can I get the class'/method/field current instance
(suppose that the application is already running)

So basicly you want to poke around in the objects in another
application? You would probably have to write your own debugger (or at
least use the debugging APIs) for that.



Mattias
 
So basicly you want to poke around in the objects in another
application? You would probably have to write your own debugger (or at
least use the debugging APIs) for that.

Kind of. I load the application, do some type browsing but I want to see
the values as the application runs.

Where I can find more about the debugging API?

Cezar
 
Where I can find more about the debugging API?

In the SDK Tool Developers Guide\docs directory. Note that these are
native COM APIs.



Mattias
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top