I'm doing a project using DynamicMethods and have some questions. Note: I'm not 
sure, but this may only be available in .NET 2.0.

#1 After I emit an instruction, is there any way for me to delete it or 
otherwise modify it? After I call the function for the first time, I can still 
emit instructions to it, which would lead me to believe they can be edited 
after being compiled. However, when I add a new instruction to the end of it, 
such as ldc_i4_0, I don't get an error saying that the runtime has found an 
invalid program, which leads me to believe that the JIT compiler doesn't 
recompile it even though I've added new instructions. Since I reference some of 
these functions from other functions, I can't just create new methods, 
otherwise I have to recompile the functions that point to them in order to 
force them to reference the new version of the function.

#2 DynamicMethods are static, but I would like to use them as if they were 
instance methods. Does anyone have a good, efficient suggestion on how to do 
this?

#3 This may go along with #2, but how do I reference an external variable? For 
example, from my dynamic method, how can I check the value of an integer in my 
program without using a function call to my program? I want to reference it 
directly.

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to