Now I know there are quite a few questions regarding this but in general they refer to c++ libraries.
I have a fairly important C dll (approximately 2800 functions) and I need to make an API for about 70 of these callable in C#. I started off using P/Invoke but it's pretty tedious because I have complex structures to pass and return from the C code (structures with pointers to others, double pointers, etc) and it's taking me alot of time to get what I need.
Now I don't know C++/CLI at all but I have a bit of experience with C++ (not a lot though).
I am wondering if it's worth making the effort to learn this for my project. Will using a C++ wrapper enable me not to have to struggle with marshalling structures, allocating pointers in global heap, etc or not?....
Thanks a lot and big ups to this great community
That's quite a large surface area. I think C++/CLI will be easier than P/invoke. You don't need to use any C++ features, you can write what is essentially C and compile and export it with C++/CLI.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With