积极答复者
MessageBox用法报错,类型转换问题

问题
-
大家好,
最近看教材有下面代码,关于消息响应的。
case WM_CHAR:
char szChar[20];
sprintf (szChar, " the char is %d ", wParam);
MessageBox(hWnd, szChar , NULL, MB_YESNO);
break;
发现编译通不过,错误是出现在 MessageBox中的szChar里
我把它换成其他任何字符串"hello"等,都不可以,怎么解决呢?
thanks
报错如下
error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'char [20]' to 'LPCWSTR'