[quoted text, click to view] Takeshi wrote:
> Hi All,
>
> I am impressed with the aesthetic (UI) appeal of DotNet, but not by
> much else, like it's new fangled languages etc... I have a legacy C++
> 3tier application, which uses C++ DLLs. I would like to use the DotNet
> frontend (e.g. the PL provided by infragistics). However, I don't want
> to start messing about with Managed C++ etc. Is there anyway I can use
> my C++ DLLs (and C++ code of my application) and "bind" them to a
> DotNet UI?
>
> Any ideas/suggestions will be very much appreciated.
You can use Interop from any .NET language to use your DLL as long as they
are straight functions. But you will have to use some .NET language to
implement your .NET front end. Even Interop this way may have some
marshalling issues if the .NET types and the DLL function signature types
are different, which will require some .NET marshalling attributes to get
things right. If you use MC++, you don't need to use Interop as IJW ( It
Just Works ) makes it unnecessary.
However if your DLL is C++ classes, you need to use MC++. You can then:
1) Recompile your DLL as an unmanaged DLL and add DLL functions which create
an object and a return a pointer and delete the object, all from within your
DLL. You will use this creation and deletion rather than 'new' and 'delete'.
Then you can have a pure MC++ front end operating with an unmanaged C++ back
end.
or
2) Create a mixed mode MC++ front end assembly which uses your DLL ( DLL
still needs to be compiled as unmanaged C++ DLL with whatever version of
VC++ you are using ). There are a number of things you need to do in order
to implement your mixed mode MC++ assembly, all documented in MSDN under
"Converting Managed Extensions for C++ Projects from Pure Intermediate
Language to Mixed Mode".