cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Windows Programming
simple message box error
simple message box error
Aug 12, 2014 at 4:31am UTC
blobbob110
(16)
I just want to make a message box pop up with a custom message. My compiler says
--
error: cannot convert 'const wchar_t*' to 'LPCSTR {aka const char*}' for argument '2' to 'int MessageBoxA(HWND, LPCSTR, LPCSTR, UINT)'|
--
heres my code:
1
2
3
4
5
6
7
8
9
10
#include <Windows.h>
int
main(){ MessageBox( NULL, L
"Message"
, NULL, NULL ); }
--
help.
Last edited on
Aug 12, 2014 at 5:44am UTC
Aug 12, 2014 at 6:17am UTC
Disch
(13742)
You're using the wrong character type. MessageBox takes TCHARs, not wide chars.
See this for detailed explanation:
http://www.cplusplus.com/forum/windows/106683/
Last edited on
Aug 12, 2014 at 6:17am UTC
Aug 12, 2014 at 6:37am UTC
blobbob110
(16)
I can't possibly say how much I appreciate the help!
Topic archived. No new replies allowed.