C++ and .NET compatability

  • Thread starter Thread starter Timothy V
  • Start date Start date
T

Timothy V

Hi,
Is it possible for a non-.net C++ application to use a .NET DLL file?

Thanks in advance,

Tim.
 
Timothy V said:
Is it possible for a non-.net C++ application to use a .NET DLL file?

You can expose .NET classes through COM, thus making those classes accesible
to a non-.NET C++ application. You can export a type library for the .NET
component using the TLBEXP tool, and you can register it for use through COM
with REGASM.
 
Ian Griffiths said:
You can expose .NET classes through COM, thus making those classes
accesible to a non-.NET C++ application. You can export a type library
for the .NET component using the TLBEXP tool, and you can register it for
use through COM with REGASM.

In addition to that, you can also create a .NET DLL with MC++ that is
directly accessible from unmanaged code (like any other DLL), or you can
host the CLR (see for example the .net command-line debugger cordbg)

As a rule of thumb:
- COM interop is quite easy to use, but it has a little performance overhead
- creating an MC++ wrapper is very flexible, but it is more work, too
- hosting the CLR directly is *quite* complex - if you don't intend to write
a debugger, profiler or something alike, it's probably not worth the effort

Niki
 
Back
Top