Hosting the CLR and IJW

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

We have a native VC++ server application I'm planning on adding support to
allow our customers to write synchronous event handlers using .NET. From my
research it appears hosting the CLR using the new hosting interface will give
me the most flexablitity in configuring and controling the CLR. Although this
will require some limited use of COM to get running I'd like to avoid using
COM, if possible, for communicating between the server and event handlers, so
I thought IJW might be a good alternative. So, is it possible to use the
hosting API to load the CLR, but use IJW to make calls and send data between
the server and the handlers written in managed code? Are there any examples
you could point me to?

Thanks,
Steve
 
SteveW said:
We have a native VC++ server application I'm planning on adding support to
allow our customers to write synchronous event handlers using .NET. From
my
research it appears hosting the CLR using the new hosting interface will
give
me the most flexablitity in configuring and controling the CLR.
Yup.

Although this will require some limited use of COM to get running I'd like
to
avoid using COM, if possible, for communicating between the server and
event
handlers, so I thought IJW might be a good alternative.

My sentiments, exactly.
So, is it possible to use the hosting API to load the CLR, but use IJW to
make
calls and send data between the server and the handlers written in managed
code?

That's pretty much what I do. I have a native application that uses
CorBindToRuntimeEx() to start the CLR and then a smidgen of COM to gain
access to the deafult domain, load an assembly or two, stuff like that.
Later, it's IJW (now renamed "C++ interop") that allows me to create managed
objects and invoke methods on them.

I don't use .Net events per-se but I don't know why you could not.
Are there any examples you could point me to?

I don't know of any. I started my project in the VS2003 timeframe, and when
I did, I found the book "Essential Guide to Managed Extensions for C++"
ISBN:1-893115-28-3 by Challa and Laksberg of the VC++ team to be my best
friend. :-)

I'm not sure what the best reference for VS2005 is. Someone here may pop-in
with a suggestion.

Regards,
Will
 
So, I'm back to working on this again and I have another question. If I load
the CLR using CorBindToRuntimeEx and I decide to use IJW (C++ Interop) I
assume the CLR will not try and load again when the C++/CLI code is loaded
correct? Also, I assume once the managed class is loaded the C++/CLI code
will not require any use of COM interfaces that were used to create the CLR,
default domain, or manged host interface correct?

I'm not that familiar with what's required in this scenario.

Thanks
 
Back
Top