【发布时间】:2015-09-15 12:09:02
【问题描述】:
我从外部 .txt 文件中读取了一行文本,当我尝试通过 SetWindowText 将其放入对话框的静态文本字段时:
string line;
ifstream highscore ("highscore.txt");
if (highscore.is_open())
{
getline(highscore, line);
}
staticText.SetWindowText(_T(line));
我收到以下错误:
错误:标识符“Lline”未定义。
有没有办法从 .txt 文件中读取字符串并将其放入静态文本字段?
【问题讨论】:
-
T宏用于字符串 och 字符文字,例如T("Foo"). -
和 wifstream(更臭的版本)。