C
cctv.star
I need to dynamically load and call .NET assembly from native
application, written in C++.
I'm trying to do this by creating a (managed) module, written in C++/
CLI, whose header can be #included from native code like normal C++
header, and whose .cpp file uses C++/CLI to actually load and
call .NET assembly.
It kind of works right now, but not exactly how I want it to. Ideally,
I want to have something like a C++ wrapper class, which hides behing
its public interface all .NET stuff. In particular, I want the
lifetime of this wrapper to correspond to the time the .NET assembly
is loaded and accessible. The trouble is, a C++ class cannot contain
handles to any .NET objects. I cannot even create a global or static
handle. Right now evey time I need to call the assembly, I need to
load it. How to overcome this limitation?
I suspect I can wrap all .NET stuff in COM, but ideally I'd like to
stay away from (directly) calling COM and use C++/CLI instead.
application, written in C++.
I'm trying to do this by creating a (managed) module, written in C++/
CLI, whose header can be #included from native code like normal C++
header, and whose .cpp file uses C++/CLI to actually load and
call .NET assembly.
It kind of works right now, but not exactly how I want it to. Ideally,
I want to have something like a C++ wrapper class, which hides behing
its public interface all .NET stuff. In particular, I want the
lifetime of this wrapper to correspond to the time the .NET assembly
is loaded and accessible. The trouble is, a C++ class cannot contain
handles to any .NET objects. I cannot even create a global or static
handle. Right now evey time I need to call the assembly, I need to
load it. How to overcome this limitation?
I suspect I can wrap all .NET stuff in COM, but ideally I'd like to
stay away from (directly) calling COM and use C++/CLI instead.