However, in the c++ code I need to retrieve the string value and work with it so I can change it. The app crash when I dereference the string value. Here's the code:
int ValueOK(std::string *pwd, std::string generalResult)
{
std::string newValue;
std::string _pwd = *pwd; <---- crash here
for (int temp = 0; temp < _pwd.length(); temp++){
newValue += "e";
//stuff to do....
}
I think that the problem is that the internal representations of System.String in C# and std::string in C++ are different. Are you able to pass around basic types such as int like this? Try doing it with a char array instead of string.