SetTextColor(hdc, RGB(0, 0, 0));
char str[20]="";
sprintf(str, "sorce: %d", sorce);
TextOut(hdc, 930, 810, str,strlen(str));
It showed the error that char* cannot be converted to LPCWSTR. How can I solve it?
SetTextColor(hdc, RGB(0, 0, 0));
char str[20]="";
sprintf(str, "sorce: %d", sorce);
TextOut(hdc, 930, 810, str,strlen(str));
It showed the error that char* cannot be converted to LPCWSTR. How can I solve it?
The W in LPCWSTR means wide characters. You have a few options.
You can change from using char types to wchar_t
You can convert using codecvt or Win32 API
Use TextOutA to keep using char types.