Unmanaged C++ to MSIL??

J

John Doe

Hi all,
I have a lot of confusion about what this runtime environment is.

When I write an application with unmanaged code and unmanaged data, can
I compile it to the MSIL, or it will compile mandatorily to the x86
instruction set?




If I can compile to MSIL:

In this case it will probably run also on WindowsXP on Alpha and Itanium
architectures where there is the .Net runtime by Microsoft, right?

But then why the go-mono people say that their .net environment
implementation cannot run partially unmanaged code? Is it just "their"
fault? What is the "part" of the runtime enviromnent that is lacking in
their implementation?
 
C

Carl Daniel [VC++ MVP]

John said:
Hi all,
I have a lot of confusion about what this runtime environment is.

When I write an application with unmanaged code and unmanaged data,
can I compile it to the MSIL, or it will compile mandatorily to the
x86 instruction set?

Unmanaged code is by definition not MSIL but IA32 machine language. You can
compile that same code using /clr and the compiler will generate MSIL and
some native code (a few operations can't be represented in IL). When you
compile with /clr you have managed code, but you don't have CLS-compliant
code: it can't be called from any other .NET language.
If I can compile to MSIL:

In this case it will probably run also on WindowsXP on Alpha and
Itanium architectures where there is the .Net runtime by Microsoft,
right?

If it's pure MSIL, yes. You have to adhere to specific procedures/idioms to
get a pure MSIL image out of VC++.
But then why the go-mono people say that their .net environment
implementation cannot run partially unmanaged code? Is it just "their"
fault? What is the "part" of the runtime enviromnent that is lacking
in their implementation?

I guess because they haven't implemented support for mixed-mode assemblies.
That may be outside the ECMA spec for the CLR - I'd guess it probably is.
In any case, you certainly can't take a mixed-mode assembly and run it on an
architecture for which is was not compiled.

-cd
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top