MessageBox( NULL, e.getFullDescription().c_str(), "An exception has occurred!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
// Compiler Error
1>.\main.cpp(36) : error C2664: 'MessageBox' : cannot convert parameter 2 from 'const char *' to 'LPCTSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
Thanks
C++ MessageBox Error
I used to be able to fix this error but for some reason I forgot how.
Anyone know?
It looks like your program is being compiled in Unicode mode. Either switch to using wide character strings or change your project to be compiled in MBCS mode. For MSVC it's under project properties/general/character set.
On a side now, MessageBox has nothing what-so-ever to do with C++ ;-) It's part of the Windows Win32 API which is all C.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement