I thought the problem was in my C ++ function, but I tried this
C ++ function in C ++ dll:
bool __declspec( dllexport ) OpenA(std::string file) { return true; }
C # code:
[DllImport("pk2.dll")] public static extern bool OpenA(string path); if (OpenA(@"E:\asdasd\"))
I get an exception that the memory is corrupt, why?
If I remove the std :: string parameter, it works fine, but it does not work with std :: string.
c ++ c # dll
Ivan Prodanov
source share