www.pudn.com > Stud_info.rar > Stud_infoView.cpp
// Stud_infoView.cpp : implementation of the CStud_infoView class
//
#include "stdafx.h"
#include "Stud_info.h"
#include "Stud_infoSet.h"
#include "Stud_infoDoc.h"
#include "Stud_infoView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CStud_infoView
IMPLEMENT_DYNCREATE(CStud_infoView, CRecordView)
BEGIN_MESSAGE_MAP(CStud_infoView, CRecordView)
//{{AFX_MSG_MAP(CStud_infoView)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG_MAP
// Standard printing commands
ON_COMMAND(ID_FILE_PRINT, CRecordView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_DIRECT, CRecordView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_PREVIEW, CRecordView::OnFilePrintPreview)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CStud_infoView construction/destruction
CStud_infoView::CStud_infoView()
: CRecordView(CStud_infoView::IDD)
{
//{{AFX_DATA_INIT(CStud_infoView)
// NOTE: the ClassWizard will add member initialization here
m_pSet = NULL;
//}}AFX_DATA_INIT
// TODO: add construction code here
}
CStud_infoView::~CStud_infoView()
{
}
void CStud_infoView::DoDataExchange(CDataExchange* pDX)
{
CRecordView::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CStud_infoView)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BOOL CStud_infoView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CRecordView::PreCreateWindow(cs);
}
void CStud_infoView::OnInitialUpdate()
{
m_pSet = &GetDocument()->m_cstudentSet;
CRecordView::OnInitialUpdate();
GetParentFrame()->RecalcLayout();
ResizeParentToFit();
}
/////////////////////////////////////////////////////////////////////////////
// CStud_infoView printing
BOOL CStud_infoView::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
void CStud_infoView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}
void CStud_infoView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
/////////////////////////////////////////////////////////////////////////////
// CStud_infoView diagnostics
#ifdef _DEBUG
void CStud_infoView::AssertValid() const
{
CRecordView::AssertValid();
}
void CStud_infoView::Dump(CDumpContext& dc) const
{
CRecordView::Dump(dc);
}
CStud_infoDoc* CStud_infoView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CStud_infoDoc)));
return (CStud_infoDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CStud_infoView database support
CRecordset* CStud_infoView::OnGetRecordset()
{
return m_pSet;
}
/////////////////////////////////////////////////////////////////////////////
// CStud_infoView message handlers