I am making a computer app in C++/CLR and I just hit the wall. I'm loading the dll using the loadlibrary
function and I am able to call the functions too but when I try to send a parameter for example if my function is:
std::string msgbox(std::string str)
{
MessageBoxA (0,str.c_str(),"TiTle", MB_OK | MB_ICONINFORMATION);
return str;
}
In a native c++ app when I call the function after loadlibrary
and getprocaddress
std:: tmp = msg ("String");
tmp
becomes "String"; and I see a Message box with String as the message but if I use C++/CLR I get like some rubbish while printing the message content in the message box if I pass in a parameter and the tmp variable would contain some trash text too how can I just load it the same way as I am doing but without this trash in the way
This is the output and the source code too:
Source: https://uploadfiles.io/itm93
Error images: https://imgur.com/a/WM7MK4c