标题:[原创]VC6.0的切分窗口问题
取消只看楼主
niuyi
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2007-8-1
 问题点数:0 回复次数:0 
[原创]VC6.0的切分窗口问题


在使用VC6.0实现窗口切分时,使用如下代码:

BOOL CMainFrame::OnCreateClient( LPCREATESTRUCT lpcs, CCreateContext* pContext )
{
CRect rc;
GetClientRect(&rc);
CSize paneSize(rc.Width()/2,rc.Height()/2);
m_Splitter.CreateStatic(this,2,1);
m_Splitter.CreateView(0,0,RUNTIME_CLASS(CExampleView),paneSize,pContext);
m_Splitter.CreateView(1,0,RUNTIME_CLASS(CExampleView),paneSize,pContext);

return TRUE;
}

在框架类的实现文件中包含文档类和视图类的头文件:
#incude "ExampleView.h"
#include "ExampleDoc.h"
会出现如下编译错误:
f:\vc应用编程150例\example004\exampleview.h(21) : error C2143: syntax error : missing ';' before '*'
f:\vc应用编程150例\example004\exampleview.h(21) : error C2501: 'CExampleDoc' : missing storage-class or type specifiers
f:\vc应用编程150例\example004\exampleview.h(21) : error C2501: 'GetDocument' : missing storage-class or type specifiers
Error executing cl.exe.

将包含头文件反过来写,即
#include "ExampleDoc.h"
#incude "ExampleView.h"
编译通过且可以运行。这是为什么?

搜索更多相关主题的帖子: 切分 窗口 
2007-08-01 20:05



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-159744-1-1.html




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

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