[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.interop

How to bind to existing CLR in an unmanaged container process?

krzys

8/4/2007 4:54:00 PM

Hi,

I'm implementing an unmanaged C++ embedded object to live in OLE containers,
such as WINWORD.EXE, that needs to host and execute some .NET code. I would
normally instantiate my CLR from the unmanaged code by CorBindToRuntimeEx,
then instantiate my .NET component in it. However, in many places it is noted
that one cannot host two different versions of CLR in the same process. Since
I don't control the code of my container (which would be WINWORD.EXE, for
example), I can't know in advance whether there are any CLRs already running
in it. Is it possible to somehow learn this, then, and possibly bind to some
already running instance of CLR in the process to execute my .NET code, as
opposed to creating a private CLR myself? What other options do there exist
to host my .NET code in an unmanaged process where other instances of CLR
might be running, especially if these CLRs might be older versions of .NET?
Is it possible to guarantee that my personal freshly updated copy of .NET 3.5
gets loaded first, and everything else is sharing it afterwards?

Thanks,
Krzys
http://www.cs.cornell.e...