首页上一页 1  下一页尾页 1 条记录 1/1页
        为何在创建一个简单的程序当中老是显示执行 cl.exe 时出错.??????????
                 	
                        发表在C语言图书答疑
                        2009-07-28                                                
                    		
                                                                            	
                        
                        
                    
                    
                    	是否精华
                    	是
                    	否
                    
                    
                    
                            版块置顶:
                            是
                            否
                        
                    
                                           我是按照书上的步骤按照书上写的这一段代码!
void CHelloDlg::OnOK()
{
// TODO: Add extra validation here
CFont font;
font.CreatePointFont(200,"宋体");
GetDlgitem(IDC_STATIC)->SetWindowText("Hello Visual C++");
GetDlgitem(IDC_STATIC)->SetFont(&font);
//CDialog::OnOK();
}
但是为什么输好之后总是显示如下代码!
--------------------Configuration: Hello - Win32 Debug--------------------
Compiling...
HelloDlg.cpp
D:\Hello\HelloDlg.cpp(177) : error C2065: 'GetDlgitem' : 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
D:\Hello\HelloDlg.cpp(180) : error C2143: syntax error : missing ';' before '}'
执行 cl.exe 时出错.
Hello.exe - 1 error(s), 0 warning(s)
请问问题出在哪了?为何总是不成功?
                
        	
        
        
    void CHelloDlg::OnOK()
{
// TODO: Add extra validation here
CFont font;
font.CreatePointFont(200,"宋体");
GetDlgitem(IDC_STATIC)->SetWindowText("Hello Visual C++");
GetDlgitem(IDC_STATIC)->SetFont(&font);
//CDialog::OnOK();
}
但是为什么输好之后总是显示如下代码!
--------------------Configuration: Hello - Win32 Debug--------------------
Compiling...
HelloDlg.cpp
D:\Hello\HelloDlg.cpp(177) : error C2065: 'GetDlgitem' : 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
D:\Hello\HelloDlg.cpp(180) : error C2143: syntax error : missing ';' before '}'
执行 cl.exe 时出错.
Hello.exe - 1 error(s), 0 warning(s)
请问问题出在哪了?为何总是不成功?

 
	
                                                 VIP会员
VIP会员 购物车
购物车

 私信
                         私信 
                     发表新帖
发表新帖 立即签到
立即签到 
        		  
        		 
         		 关注
关注
                  回复
 回复 支持(
                	支持( 反对(
                    反对( 
                







 
                     
                     
					 
						 
						 
						 
						