Call Graph

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I'm implementing an exception management application block in C# and I'm
facing a problem. I would like to get a reference to the caller object of
another object method I'm currently in, if it is possible. Let me precise
that I don't want this reference to be a parameter of my method. Could anyone
help me?

Thanks,

Didier
 
Didier,

You won't be able to do it without passing it as a parameter. You can
access the stack trace, which will give you the MethodInfo instances which
correspond to the methods that were called, but you won't be able to access
the actual instance itself (it just gives method information, not instance
information).

Hope this helps.
 
Back
Top