Load an object reference onto the stack ???
- From: "VivekR" <KenBase@xxxxxxxxx>
- Date: 20 Apr 2006 16:13:11 -0700
Hi
I have a class CodeGen in which GenerateILBody is a method that uses
ILGenerator.Emit to create the IL code as method body for a dynamic
method DynMethod. GenerateILBody at runtime must call another method
CallBack of the class CodeGen.
All i have to do is to emit the IL code that loads the object reference
of CodeGen onto the stack, which means I must emit IL in GenerateILBody
to load 'this', which may look like:-
ilgen.Emit(OpCodeToLoad, this);
The this here refers to the CodeGen object reference, and at runtime
will have to use the reference to call the CallBack method.
But there is no overload in ILgenerator.Emit that takes an object
reference.
Please let me know how to load an object reference onto the stack in
IL.
Thanks
Vivek Ragunathan
.
- Follow-Ups:
- Re: Load an object reference onto the stack ???
- From: Barry Kelly
- Re: Load an object reference onto the stack ???
- From: Barry Kelly
- Re: Load an object reference onto the stack ???
- Prev by Date: Re: Comparing delegates
- Next by Date: Re: Real value of "Visible" property?
- Previous by thread: Re: Comparing delegates
- Next by thread: Re: Load an object reference onto the stack ???
- Index(es):
Relevant Pages
|