> I think you've done a good job of outlinging some
> differences between the two features. What I'd like to
[quoted text clipped - 9 lines]
> you make calls on an _AppDomain object in unmanaged code
> you'll be calling through a CCW.
But in this case the runtime is already loaded. Am I correct?
> I'd also point out that if you loaded a CCW into your
> process, and then attempted to host the runtime, that
[quoted text clipped - 6 lines]
> to create a CCW in your process the host would be asked
> to start the runtime first.
Quite interesting. I think that CCW and CLR is sometimes confusing. I do not
have access to Whidbey (at the moment), but I have a copy of Longhorn, so
I'll have a look at it. Is this API documented on the longhorn SDK on the
web?
> Finally, I'd like to point out that you might be able to
> get some of the same control via config files that you
[quoted text clipped - 5 lines]
> familiar with the hosting side than the CCW side of
> things).
Since you are "familiar" with CLR hosting, and maybe you are the right
person to ask, why don't you (=MSFT) add some more documentation about CLR
hosting? I haven't checked the Longhorn SDK, but the .NET 1.1 SDK
documentation is quite poor in this field (and this somewhat strange, since
there is a lot of stuff related to managed-unmanaged interaction).
Have a nice day
GV
> Hopefully this helps :)
>
[quoted text clipped - 13 lines]
> >GV
> >.
"Dino Viehland [MS]" - 19 Dec 2003 17:19 GMT
>> So for example if you host the runtime any CCW's you use
>> after you've loaded the runtime will use the runtime that
[quoted text clipped - 3 lines]
>> you make calls on an _AppDomain object in unmanaged code
>> you'll be calling through a CCW.
> But in this case the runtime is already loaded. Am I correct?
Yes, after you've loaded the runtime via the hosting interfaces you'll then
be using the CCWs to call into the runtime.
>> I'd also point out that if you loaded a CCW into your
>> process, and then attempted to host the runtime, that
[quoted text clipped - 11 lines]
> I'll have a look at it. Is this API documented on the longhorn SDK on the
> web?
Unfortunately we haven't released our documentation for this feature yet
(or any of the new hosting interfaces). It's a fairly simple API, and I'll
give you a quick description here. In mscoree.h you'll find the definition
of LockClrVersion. It takes 3 parameters, 1 function pointer, and 2
pointers to function pointers. You pass in a call back (hostCallback).
mscoree will pass you back the begin/end setup pointers. mscoree will call
hostCallback when someone wants to use managed code. During the callback
the host performs the normal hosted CLR startup, but before they start the
runtime they call the passed in pBeginHostSetup callback, and when they're
done they call the pEndHostSetup callback. The callbacks & the starting of
the runtime all need to occur on the same thread (this is how we know
you're the one who should be starting the runtime, and that someone else
isn't trying to sneak by it).
You'll find that the callback function (FLockCllrVersionCallback) is
defined in mscoree as well, takes no parameters, and returns an HRESULT.
You'll want to return success (eg, S_OK, S_FALSE, etc...) from the callback
to allow managed code to run, or failure if you don't want to allow it to
run.
> Since you are "familiar" with CLR hosting, and maybe you are the right
> person to ask, why don't you (=MSFT) add some more documentation about CLR
> hosting? I haven't checked the Longhorn SDK, but the .NET 1.1 SDK
> documentation is quite poor in this field (and this somewhat strange, since
> there is a lot of stuff related to managed-unmanaged interaction).
I think the best documentation on this that we have today is
http://www.gotdotnet.com/team/clr/about_clr_Hosting.aspx. There's white
papers, specs on the interfaces, etc... I don't know if this is included
in the SDK or not (and if not, why not), but I can bring this up to the PM
in charge of this area. Have you seen this web page before? Do you think
it gives a good description of the hosting? Or is there more that you'd
like to hear about? And if so, what?