Home All Groups Group Topic Archive Search About

Who is my calling object?

Author
4 Jan 2005 9:08 PM
Bob L.
Hi everyone,

I am implementing I method where it would be convenient to get the instance
of the object that is calling me. I know I can get the calling method using
the StackFrame class, and I can get the calling assembly, but what about the
instance of the object which implements the calling method?

Thanks,
Bob L.

Author
4 Jan 2005 10:23 PM
John Saunders
"Bob L." <nospam.info1@libertyfamily.net> wrote in message
news:eWXwcGq8EHA.3988@TK2MSFTNGP10.phx.gbl...
> Hi everyone,
>
> I am implementing I method where it would be convenient to get the
> instance
> of the object that is calling me. I know I can get the calling method
> using
> the StackFrame class, and I can get the calling assembly, but what about
> the
> instance of the object which implements the calling method?

Have the calling object pass itself as a parameter. Believe me when I tell
you that you don't want to limit yourself to operating on the calling object
only. There may come a day when some intermediate object will be introduced.

John Saunders

Bookmark and Share