vc2010 学习笔记3

VC++之框架窗体之静态切分窗口

一、创建单文档应用程序

二、添加变量、函数

       1、添加变量


        2、添加函数


三、添加代码(红色部分)

      1、在“CCSDIView.cpp”内添加包含语句

// 静态切分窗口View.h : interface of the CCSDIView class

#include "静态切分窗口Doc.h"
#include "静态切分窗口.h"
#include "MainFrm.h"

       2、在“MainFrm.cpp”内添加包含语句

// MainFrm.cpp : implementation of the CMainFrame class

"stdafx.h"
#include "静态切分窗口.h"

#include "MainFrm.h"
#include "静态切分窗口Doc.h"
#include "静态切分窗口View.h"

      3、添加代码

BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)

                                                                                                                      //重载该函数 
{
// TODO: Add your specialized code here and/or call the base class
CRect cr;
GetClientRect(&cr);
CSize paneSize(cr.Width()/3,cr.Height()/3);
m_splitter.CreateStatic(this,3,1);
m_splitter.CreateView(0,0,RUNTIME_CLASS(CCSDIView),paneSize,pContext);
m_splitter.CreateView(1,0,RUNTIME_CLASS(CCSDIView),paneSize,pContext);
m_splitter.CreateView(2,0,RUNTIME_CLASS(CCSDIView),paneSize,pContext);
//return CFrameWnd::OnCreateClient(lpcs, pContext);
return TRUE;
}

四、编译

五、运行


六、函数说明

       1、CWnd::GetClintRect函数声明

       2、CSplitterWnd::CreateStatic函数声明

       3、CSplitterWnd::CreateView函数说明 

注:

两个窗口,怎么对应于一个文档呢?看这个ppt。

http://wenku.baidu.com/view/6b29bf28bd64783e09122b89.html 

原文地址:https://www.cnblogs.com/gisbase/p/2200157.html