Passing strings from C# to C++ DLL and back — minimal example
You cannot pass a C++ std::string across an interop boundary. You cannot create one of those in your C# code. So your code can never work. You need to use interop friendly types at the interop boundary. For instance, null-terminated arrays of characters. That works well when you allocate and deallocate the memory in the … Read more