Seems simple but can't find the solution.
I want something like this
catch (Exception^ ex)
{
MessageBoxA(NULL, ex->ToString(), "", MB_OK);
}
But it says Plattform::string ^ is incompatible with LPCSTR.
Seems simple but can't find the solution.
I want something like this
catch (Exception^ ex)
{
MessageBoxA(NULL, ex->ToString(), "", MB_OK);
}
But it says Plattform::string ^ is incompatible with LPCSTR.
Copyright © 2021 Jogjafile Inc.
Platform::String is .NET class, which is of course is not compatible with good old
char*.To fix this you need to do 2 things.
First, convert
Platform::Stringtowchar_t*, since it's unicode string. Use methodData()Second, use MessageBoxW, since we are working with unicode, not ANSI.
Resulting code should look like this: