Difference of C++/CLR and Hosting the Common Language Runtime


hi !

 

i wondering difference technical point of view between c++/clr in managed , unmanaged mixed mode vs. hosting common language runtime. later documentation says it's slow switch between host , hosted code because transition between managed , unmanaged code slow. same c++/clr? happens if compile unmanaged class in c++/clr. native code , same compared having native code + hostind clr , calling managed code it? or c++/clr create kind of managed code unmanaged classes , jsut silmulates real native code, switches between managed , unmanaged aren't necessary?

 

i hope can explain me or direct me document can.

 

best regards

   marc

i don't think can compare these two. hosting clr when have unmanaged code allowing .net code used in the native process. example of when use managed addin in ie. ie host clr needed run it.

http://msdn2.microsoft.com/en-us/library/9x0wh2z3.aspx

 

hosting clr can complicated there limit on 1 clr per process. if have 2 ie addins , written different versions of clr, 1 1.1 , other 2.0. there no guarantee clr loaded , 1 of addins might fail due differences between 1.1 , 2.0.

 

mixed mode assemblies way merging managed , unmanaged code in way works. there still same need marshal data between managed , unmanaged code can write code 1 project. mixed mode assembly should seen managed assembly needs clr run having unmanaged parts run outside clr. more details mixed mode.

http://msdn2.microsoft.com/en-us/library/ms235282(vs.80).aspx

 

the native code in in mixed mode assembly run in clr process using marshalling while hosting clr allows managed code run under native code. hosting clr can described oppostite mixed-mode assemblies.

 

you can compare managed c++ mixed mode assemblies making 1 assembly in c# uses native dll written in c++. c# code needs communicate c++ dll using p/invoke , marshalling. mixed-mode managed c++ assembly make easier still need take marshalling costs consideration when comparing these approaches.



.NET Framework  >  Common Language Runtime Internals and Architecture



Comments

Popular posts from this blog

Azure DocumentDB Owner resource does not exist

job syspolicy_purge_history job fail in sqlserver 2008

Trying to register with public marketplace error with 'Get-AzureStackStampInformation'