call managed/unmanaged classes from unmanaged code

B

bonk

Hello,

I am trying to create a c++ dll or lib (not COM) that contains a little
bit of managed code and a lot of unmanged code using c++/CLI. Basically
some classes rely on managed bits internally. But nothing of that
managed stuff will be exposed to the outside. The user of that dll is
suppsed to "see" only plain unmanaged c++ classes so that if he uses
that dll he does not have to compile his code using that /CLR switch.

Do you think something like that is possible? If so, how ?
Or will I have to use COM if I want create and use dlls that also
contain managed code ?
 
M

Marcus Heege

It is possible.

Issues I am aware of (OTOMH):
* somewhat increased load times
* __declspec(appdomain) variables are initialized when the CLR is loaded (by
the module .cctor) - don't access them earlier

If you face other issues, let me know.

Marcus Heege
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top