Getting Started With App Wizard
Getting Started With App Wizard
Getting Started With App Wizard
#include "stdafx.h"
#include "appwiz.h"
#include "Dlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDlg dialog
BEGIN_MESSAGE_MAP(CDlg, CDialog)
//{{AFX_MSG_MAP(CDlg)
ON_EN_CHANGE(IDC_EDIT3, OnChangeEdit3)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDlg message handlers
void CDlg::OnOK()
{
// TODO: Add extra validation here
UpdateData(true);
CDialog::OnOK();
}
BOOL CDlg::OnInitDialog()
{
CDialog::OnInitDialog();
CProgressCtrl *pprog=(CProgressCtrl*)GetDlgItem(IDC_PROGRESS1);
pprog->SetRange(0,100);
pprog->SetPos(1);
return TRUE;
}
void CDlg::OnChangeEdit3()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
UpdateData(true);
CProgressCtrl *pprog=(CProgressCtrl*)GetDlgItem(IDC_PROGRESS1);
pprog->SetPos(m_aggr);
}
void CDlg::OnCancel()
{
// TODO: Add extra cleanup here
exit(0);
CDialog::OnCancel();
}
// appwizView.cpp : implementation of the CAppwizView class
#include "stdafx.h"
#include "appwiz.h"
#include "Dlg.h"
#include "appwizDoc.h"
#include "appwizView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CAppwizView
IMPLEMENT_DYNCREATE(CAppwizView, CView)
BEGIN_MESSAGE_MAP(CAppwizView, CView)
//{{AFX_MSG_MAP(CAppwizView)
// 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, CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_DIRECT, CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_PREVIEW,
CView::OnFilePrintPreview)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CAppwizView construction/destruction
CAppwizView::CAppwizView()
{
// TODO: add construction code here
}
CAppwizView::~CAppwizView()
{
}
return CView::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// CAppwizView drawing
CDlg d;
d.DoModal();
if(d.m_name==_T(""))
{
MessageBox("Please Enter Name !!");
goto Q;
}
else
pDC->TextOut(x,100,"NAME : " + d.m_name);
if(d.m_roll==_T(""))
{
MessageBox("Please Enter Roll Number !!");
goto Q;
}
else
pDC->TextOut(x,130,"ROLL : " + d.m_roll);
if(d.m_gender==0)
pDC->TextOut(x,160,"SEX : MALE");
else if(d.m_gender==1)
pDC->TextOut(x,160,"SEX : FEMALE");
else
{
MessageBox("Please select Gender !!");
goto Q;
}
if(d.m_dept==_T(""))
{
MessageBox("Please Select Department !!");
goto Q;
}
else
pDC->TextOut(x,190,"DEPT : " + d.m_dept);
if(d.m_year==_T(""))
{
MessageBox("Please select year of study !!");
goto Q;
}
else
pDC->TextOut(x,220,"YEAR : " + d.m_year);
/////////////////////////////////////////////////////////////////////////////
// CAppwizView printing
/////////////////////////////////////////////////////////////////////////////
// CAppwizView diagnostics
#ifdef _DEBUG
void CAppwizView::AssertValid() const
{
CView::AssertValid();
}
/////////////////////////////////////////////////////////////////////////////
// CAppwizView message handlers
OUTPUT