Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
SetTextColor(hdc, RGB(0, 0, 0)); char str[20]=""; sprintf(str, "sorce: %d", sorce); TextOut(hdc, 930, 810, str,strlen(str));
它显示了 char* 无法转换为 LPCWSTR 的错误。我该如何解决?
LPCWSTR 中的 W 表示宽字符。你有几个选择。
您可以从使用 char 类型更改为 wchar_t
您可以使用 codecvt 或 Win32 API 进行转换
使用 TextOutA 继续使用 char 类型。