首页上一页 1 下一页尾页 2 条记录 1/1页
急 请教《visual c++ 从入门到精通》
发表在C语言图书答疑
2009-09-04
是否精华
是
否
版块置顶:
是
否
为什么我创建一个简单的MFC文件老是双引号出错?
请老师帮忙解决下!
void CHelloDlg::OnOK()
{
// TODO: Add extra validation here
CFont font;
font.CreatePointFont(200,"宋体");
GetDlgltem(IDC_STATIC)->SetWindowText("Hello Visual c++");
GetDlgltem(IDC_STATIC)->SetFont(&font);
//CDialog::OnOK();
}
我现在用的是中文版的,以前用英文的也是引号出错! 老师请开导下!
--------------------Configuration: hello - Win32 Debug--------------------
Compiling resources...
Compiling...
StdAfx.cpp
Compiling...
hello.cpp
helloDlg.cpp
D:\hello\helloDlg.cpp(176) : error C2018: unknown character '0xa3'
D:\hello\helloDlg.cpp(176) : error C2018: unknown character '0xbb'
D:\hello\helloDlg.cpp(177) : error C2146: syntax error : missing ';' before identifier 'GetDlgltem'
D:\hello\helloDlg.cpp(177) : error C2065: 'GetDlgltem' : undeclared identifier
D:\hello\helloDlg.cpp(177) : error C2227: left of '->SetWindowTextA' must point to class/struct/union
D:\hello\helloDlg.cpp(178) : error C2227: left of '->SetFont' must point to class/struct/union
Generating Code...
执行 cl.exe 时出错.
hello.exe - 1 error(s), 0 warning(s)
谢谢老师! 急与学习C++的菜鸟!
请老师帮忙解决下!
void CHelloDlg::OnOK()
{
// TODO: Add extra validation here
CFont font;
font.CreatePointFont(200,"宋体");
GetDlgltem(IDC_STATIC)->SetWindowText("Hello Visual c++");
GetDlgltem(IDC_STATIC)->SetFont(&font);
//CDialog::OnOK();
}
我现在用的是中文版的,以前用英文的也是引号出错! 老师请开导下!
--------------------Configuration: hello - Win32 Debug--------------------
Compiling resources...
Compiling...
StdAfx.cpp
Compiling...
hello.cpp
helloDlg.cpp
D:\hello\helloDlg.cpp(176) : error C2018: unknown character '0xa3'
D:\hello\helloDlg.cpp(176) : error C2018: unknown character '0xbb'
D:\hello\helloDlg.cpp(177) : error C2146: syntax error : missing ';' before identifier 'GetDlgltem'
D:\hello\helloDlg.cpp(177) : error C2065: 'GetDlgltem' : undeclared identifier
D:\hello\helloDlg.cpp(177) : error C2227: left of '->SetWindowTextA' must point to class/struct/union
D:\hello\helloDlg.cpp(178) : error C2227: left of '->SetFont' must point to class/struct/union
Generating Code...
执行 cl.exe 时出错.
hello.exe - 1 error(s), 0 warning(s)
谢谢老师! 急与学习C++的菜鸟!