| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 720 人关注过本帖
标题:一段小程序出现错误,帮忙解决下
只看楼主 加入收藏
shn521
Rank: 2
等 级:论坛游民
威 望:1
帖 子:56
专家分:52
注 册:2010-6-18
结帖率:73.33%
收藏
已结贴  问题点数:20 回复次数:10 
一段小程序出现错误,帮忙解决下
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
    // TODO: Add your specialized code here and/or call the base class
    CRect cr;
    GetClientRect(&cr);
    CSize panSize(cr.Width()/3,cr.Height()/3);
    m_splitter.CreateStatic(this,3,1);
    m_splitter.CreateView(0,0,RUNTIME_CLASS(CCSDI_2View),panSize,pContext);
    m_splitter.CreateView(1,0,RUNTIME_CLASS(CCSDI_2View),panSize,pContext);
    m_splitter.CreateView(2,0,RUNTIME_CLASS(CCSDI_2View),panSize,pContext);
    return CFrameWnd::OnCreateClient(lpcs, pContext);
}
--------------------Configuration: CSDI_2 - Win32 Debug--------------------
Compiling...
MainFrm.cpp
D:\VC练习\CSDI_2\MainFrm.cpp(116) : error C2653: 'CCSDI_2View' : is not a class or namespace name
D:\VC练习\CSDI_2\MainFrm.cpp(116) : error C2065: 'classCCSDI_2View' : undeclared identifier
D:\VC练习\CSDI_2\MainFrm.cpp(117) : error C2653: 'CCSDI_2View' : is not a class or namespace name
D:\VC练习\CSDI_2\MainFrm.cpp(118) : error C2653: 'CCSDI_2View' : is not a class or namespace name
Error executing cl.exe.
图片附件: 游客没有浏览图片的权限,请 登录注册

感谢啦

[ 本帖最后由 shn521 于 2010-9-20 12:02 编辑 ]
2010-09-19 15:03
pbreak
Rank: 7Rank: 7Rank: 7
等 级:黑侠
威 望:1
帖 子:83
专家分:558
注 册:2007-5-10
收藏
得分:0 
#include "CSDI_2View.h"
2010-09-20 10:00
shn521
Rank: 2
等 级:论坛游民
威 望:1
帖 子:56
专家分:52
注 册:2010-6-18
收藏
得分:0 
以下是引用pbreak在2010-9-20 10:00:51的发言:

#include "CSDI_2View.h"
感谢,这个试过,然后又出现了
--------------------Configuration: CSDI_2 - Win32 Debug--------------------
Compiling...
MainFrm.cpp
d:\vc练习\csdi_2\csdi_2view.h(21) : error C2143: syntax error : missing ';' before '*'
d:\vc练习\csdi_2\csdi_2view.h(21) : error C2501: 'CCSDI_2Doc' : missing storage-class or type specifiers
d:\vc练习\csdi_2\csdi_2view.h(21) : error C2501: 'GetDocument' : missing storage-class or type specifiers
Error executing cl.exe.
2010-09-20 12:01
kspliusa
Rank: 3Rank: 3
等 级:论坛游侠
威 望:1
帖 子:98
专家分:178
注 册:2009-9-27
收藏
得分:5 
试试在frame类的.cpp文件中加include<CSDI_2Doc.h>,
2010-09-20 12:57
shn521
Rank: 2
等 级:论坛游民
威 望:1
帖 子:56
专家分:52
注 册:2010-6-18
收藏
得分:0 
以下是引用kspliusa在2010-9-20 12:57:55的发言:

试试在frame类的.cpp文件中加include,
#include "CSDI_2Doc.h"和#include <CSDI_2Doc.h>都试了还是不行
2010-09-20 13:36
东海一鱼
Rank: 13Rank: 13Rank: 13Rank: 13
等 级:贵宾
威 望:48
帖 子:757
专家分:4760
注 册:2009-8-10
收藏
得分:5 
搂主的工程是手敲的话,再好好看看源码。
如果是VC自己生成的工程,还出这个错误。那你就别费劲了。直接换个IDE版本吧。

举世而誉之而不加劝,举世而非之而不加沮,定乎内外之分,辩乎荣辱之境,斯已矣。彼其于世未数数然也。
2010-09-20 14:26
shn521
Rank: 2
等 级:论坛游民
威 望:1
帖 子:56
专家分:52
注 册:2010-6-18
收藏
得分:0 
以下是引用东海一鱼在2010-9-20 14:26:28的发言:

搂主的工程是手敲的话,再好好看看源码。
如果是VC自己生成的工程,还出这个错误。那你就别费劲了。直接换个IDE版本吧。
感谢,可能是版本低了
2010-09-20 17:24
pbreak
Rank: 7Rank: 7Rank: 7
等 级:黑侠
威 望:1
帖 子:83
专家分:558
注 册:2007-5-10
收藏
得分:5 
include<CSDI_2Doc.h>放在csdi_2view.h中试试。
2010-09-21 08:20
shn521
Rank: 2
等 级:论坛游民
威 望:1
帖 子:56
专家分:52
注 册:2010-6-18
收藏
得分:0 
以下是引用pbreak在2010-9-21 08:20:27的发言:

include放在csdi_2view.h中试试。
加了#include"CSDI_2Doc.h"编译通过了,可以没有出现切分的窗口
2010-09-21 08:29
pbreak
Rank: 7Rank: 7Rank: 7
等 级:黑侠
威 望:1
帖 子:83
专家分:558
注 册:2007-5-10
收藏
得分:5 
将return CFrameWnd::OnCreateClient(lpcs, pContext);
改为return true;
2010-09-21 16:18
快速回复:一段小程序出现错误,帮忙解决下
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.013109 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved