Title: Exact Calculation
1Exact Calculation
2Basic Templat for Number
- General Templates
- Collection Class
- Number Class
- FNumber Program
3Quiz 1
- Develop Insert program for Collection Class
- template ltclass T,class Sgt
- void collectionltT,Sgtinsert(S index, T d, S
no_items1)
4Main Dialog
5Creating Number Variables
- Adding number.h to Solution
- Creating number variables
- At class CFNumberDlg public CDialog
- number A,B,C,D,npt4
- At CFNumberDlgCFNumberDlg
- npt0A npt1B npt2C npt3D
6Creating Class for the new Dialog
class CEditNumberDialog public
CDialog DECLARE_DYNAMIC(CEditNumberDialog) publ
ic CEditNumberDialog(CWnd pParent NULL,
number m) // standard constructor virtual
CEditNumberDialog() // Dialog Data enum IDD
IDD_DIALOG1 number n protected virtual
void DoDataExchange(CDataExchange pDX)
DECLARE_MESSAGE_MAP()
7Activating Edit Dialog
8HW4
- Using number class develop a calculator program
- Due Date Sunday Azar 3rd 1387
9Exact Class
- Derived from Number Class
10(No Transcript)
11FExact Dialog Based Application
12Modify FExact Dialog
13Exact Number Manipulation
IDC_EDITA
IDC_EDITB
IDC_EDITC
IDC_EDITD
IDC_EDITE
14Initiate Exact Numbers
- Adding Pre-Defined Exact Number to Project
- Including Exact Numbers in Application
- Defining A,B,C,D,E in Application
- Initiating With 0,1,2,3,4
- Copy the Numbers on associated variables
- Showing the Contents on Dialog
15Adding Pre-Defined Exact Number to Project
16Adding to Solution Explorer
- Only for Viewing Files
- Header Files
- Exact.h
- Number.h
- Collect.h
- Template.h
17Including Exact Numbers in Application and
initialization
- At FExactDlg.h
- include "exact.h
- At class CFExactDlg public CDialog
- exactltunsigned intgt A,B,C,D,E
- exactltunsigned intgt exactpt5
- At FExactDlg.cpp
- CFExactDlgCFExactDlg(CWnd pParent /NULL/)
- CDialog(CFExactDlgIDD, pParent),A(0),B(1),C(2
),D(3),E(4) -
- m_hIcon AfxGetApp()-gtLoadIcon(IDR_MAINFRAME)
- exactpt0A exactpt1B exactpt2C
- exactpt3D exactpt4E
18Assigning Variables
19Copy the Numbers on associated variables and
Display numbers
- BOOL CFExactDlgOnInitDialog()
-
- CDialogOnInitDialog()
- AStringA.PrintHex()
- BStringB.PrintHex()
- CstringC.PrintHex()
- DStringD.PrintHex()
- EStringE.PrintHex()
- UpdateData(FALSE)