3 ms·
I am pretty good about writing P/Invokes but I have no way of proving that what I did won’t create some memory overwrite or leak. Too many moving parts between
by spaetzleesser 6y ago
I am pretty good about writing P/Invokes but I have no way of proving that what I did won’t create some memory overwrite or leak. Too many moving parts between C# and C++. Nowadays I find it better to write a layer in managed C++. This seems much safer and in a sense is more straightforward.
- munchbunny 6y agoAgreed, given the choice between P/Invoke and managed C++, managed C++ often has fewer footguns, despite being rooted in C++. You have the compiler checking your usage of the native API, and you have the compiler generating .NET interfaces which your managed code can invoke directly.