www.pudn.com > TCPIPAnalyse1.rar > ChildFrm.cpp
// ChildFrm.cpp : implementation of the CChildFrame class
//
#include "stdafx.h"
#include "IrisAnalyse.h"
#include "ChildFrm.h"
#include "IrisAnalyseViewL.h"
#include "IrisAnalyseViewR.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CChildFrame
IMPLEMENT_DYNCREATE(CChildFrame, CMDIChildWnd)
BEGIN_MESSAGE_MAP(CChildFrame, CMDIChildWnd)
//{{AFX_MSG_MAP(CChildFrame)
ON_WM_GETMINMAXINFO()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CChildFrame construction/destruction
CChildFrame::CChildFrame()
{
// TODO: add member initialization code here
}
CChildFrame::~CChildFrame()
{
}
BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
if( !CMDIChildWnd::PreCreateWindow(cs) )
return FALSE;
//子窗口风格设置
/* int xSize = ::GetSystemMetrics(SM_CXSCREEN);
int ySize = ::GetSystemMetrics(SM_CYSCREEN);
cs.cx = xSize;
cs.cy = ySize;
cs.x = (xSize-cs.cx)/2;
cs.y = (ySize-cs.cy)/2;
*/ cs.style &=~ (LONG) FWS_ADDTOTITLE;
return TRUE;
}
/////////////////////////////////////////////////////////////////////////////
// CChildFrame diagnostics
#ifdef _DEBUG
void CChildFrame::AssertValid() const
{
CMDIChildWnd::AssertValid();
}
void CChildFrame::Dump(CDumpContext& dc) const
{
CMDIChildWnd::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CChildFrame message handlers
BOOL CChildFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
// TODO: Add your specialized code here and/or call the base class
//return CMDIChildWnd::OnCreateClient(lpcs, pContext);
CRect rect;
GetClientRect(rect);
//char temp[20];
//sprintf(temp,"%d %d %d %d",rect.left,rect.top,rect.right,rect.bottom);
//AfxMessageBox(temp);
if(m_wndSplitter.CreateStatic(this,1,2) == 0)
{
AfxMessageBox("CreateStatic fail");
return FALSE;
}
if(m_wndSplitter.CreateView(0,0,RUNTIME_CLASS(CIrisAnalyseViewL),
CSize((rect.right-8)/2,0),pContext) == 0)
{
AfxMessageBox("CreateViewL fail");
return FALSE;
}
if(m_wndSplitter.CreateView(0,1,RUNTIME_CLASS(CIrisAnalyseViewR),
CSize(0,0),pContext) == 0)
{
AfxMessageBox("CreateViewR fail");
return FALSE;
}
//CFrameWnd::SetActiveView
SetActiveView((CView *)m_wndSplitter.GetPane(0,1),TRUE);
return TRUE;
}
void CChildFrame::OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI)
{
// TODO: Add your message handler code here and/or call default
CMDIChildWnd::OnGetMinMaxInfo(lpMMI);
}