Shawn, Thanks for the response.
Here is a quick update on what I've learned (very little). I was hoping to avoid explicitly loading the CLR using CorBindToRuntimeEx() since the CLR was implicitly loaded in the simple case. However, given that the code blows up while trying to load all the .NET CLR DLLs before any of my code gets executed, I fear that I'll probably have to go that route. I can't use ClrCreateManagedInstance() since that would be used to create COM objects in a managed DLL, and that is what I am trying to avoid. (This assumes I understand the signature of ClrCreateManagedInstance()). I think my only hope here is to use the tachnique outlined by Grimes to create the runtime using CorBindToRuntimeEx(), create an AppDomain using ICorRuntimeHost, dynamically load my C++ managed DLL Assembly and then try to use reflection via the dual or dispatch interfaces exposed by the Assembly object to dynamically create some kind of object in my DLL that in turn would create my .NET C# classes for me which are not exposed via COM. Whew! I don't hold much hope for my success, but if I learn anything, I'll post it here. Any other ideas are most welcome. Thanks, Pete On Mon, 9 Feb 2004 03:24:04 -0500, Shawn A. Van Ness <[EMAIL PROTECTED]> wrote: >I don't know what your immediate problem might be -- even trivial MC++ >build problems make my head swim -- but have you considered skipping the >middleman (COM Interop) and simply hosting the CLR in your MFC app, >yourself? It's far, far easier than it sounds. Like, less than a dozen >lines of code. Some Google starting points: CorBindToRuntimeEx >ICorRuntimeHost > >http://www.gotdotnet.com/team/clr/HostingInterfaces.aspx > >Side question, for the panel: anyone know what's up with >ClrCreateManagedInstance? I was poking around mscoree.h the other day, and >it picqued my curiosity. It looks like this: > >STDAPI ClrCreateManagedInstance( > LPCWSTR pTypeName, REFIID riid, void **ppObject); > >It's a little less than fully documented, but Sam Gentile's blog suggests >it might be a nifty way to bypass the need to register anything, to achieve >COM interop: > >http://samgentile.com/blog/archive/2003/07/03/7868.aspx > >I'm wondering what syntax is expected of that first "typename" parameter? >I'd expect it wants to see an assembly name in there somewhere, too...? > >Whatever. Better, perhaps, to stick to the better-documented >CorBindToCurrentRuntime(), and friends. > >Cheers, >-Shawn >http://www.windojitsu.com/ > >=================================== >This list is hosted by DevelopMentor� http://www.develop.com >Some .NET courses you may be interested in: > >NEW! Guerrilla ASP.NET, 26 Jan 2004, in Los Angeles >http://www.develop.com/courses/gaspdotnetls > >View archives and manage your subscription(s) at http://discuss.develop.com =================================== This list is hosted by DevelopMentor� http://www.develop.com Some .NET courses you may be interested in: NEW! Guerrilla ASP.NET, 26 Jan 2004, in Los Angeles http://www.develop.com/courses/gaspdotnetls View archives and manage your subscription(s) at http://discuss.develop.com
