Integrating .NET and Win32 DLLs (written in Borland C++ Builder)
About a week ago I had to write a wrapper to win32 DLL (written in Borland C++ Builder) to use it under Microsoft .NET platform. I've spend some time googling around, trying different things and finally I was able to do exactly what I wanted. Because it took me quite some time to gather all information together I thought it can be useful for somebody else. So here it is:
Problem:
1. We have a win32 DLL. We own this DLL, so we can add some interface functions if we want to.
2. We need to create several instances of this DLL inside .NET application.
3. We need to be able to pass back and forth to/from managed code complicated structures with integer, char arrays etc.
4. We need to be able to have .NET callbacks which we will be calling from that win32 DLL.