embed IL-code in C++

  • Thread starter Thread starter Chris
  • Start date Start date
C

Chris

Hi,

is it possible to embed il-code in C++ ?
(much like the _asm directive used in unmanaged C++).

If not, other ways to execute il-instructions ?

thnx

Chris
 
Chris said:
is it possible to embed il-code in C++ ?
(much like the _asm directive used in unmanaged C++).

That's a good question for which I don't have an answer. :-)
If not, other ways to execute il-instructions ?

I vaguely recall reading an article in MSDN magazine which talked about
generating code and compiling it on the fly. I don't have the article near
me now but I think that this link may have some useful information if you
want to take that route:

http://msdn.microsoft.com/library/d...-us/cpref/html/frlrfSystemCodeDomCompiler.asp

Regards,
Will
 
Hi Chris,
is it possible to embed il-code in C++ ?
(much like the _asm directive used in unmanaged C++).

Nope, there isn't.
If not, other ways to execute il-instructions ?

Well, depends on what you want to do. BUt if you definitely need to use IL,
then you'll probably have to resort to putting that code into a separate
assembly and compile it using ILASM.exe

(I'm not 100% sure, but you could check to see if it's possible to generate
IL dinamically using Reflection.Emit... it should be, if I remember
correctly)
 
Back
Top