Supporting C style DLL exporting functions

The current version of xInterop NGen++ only supports generating C# wrapper for native C++ DLL exporting C++ class. Developers have been asking for supporting C style DLL and we have started working on supporting this feature. Since the xInterop NGen++ has been able to generate C# wrapper assembly wrapping C++ classes quite well, we will not try to change anything to the existing code base, instead, we will take a approach by creating a new C++ DLL with a wrapper C++ class to wrap the existing export functions in the C style DLL as static methods and then it will simply use the existing mechanism to generate C# wrapper for the new C++ DLL and class.

For now, you may want to manually create a C++ class to wrap the functions exported from a c style DLL, and then use xInterop NGen++ to generate a C# wrapper library. It won’t take very long to create a C++ wrapper class, you are basically going to copy and paste the function signatures and wrap them as public static methods inside a new C++ class.

Translate »