Introduction
To
Microsoft Visual
C++ 6.0
By: Shahed Shahir
Email: shahir@uwindsor.ca
Office hour: Mondays 9:00am-11:00am 1
Requirements
• Object Oriented Programming
• C++ programming
2
Introduction
Advantage:
Microsoft Visual C++ is a powerful tool. Visual
C++ is inherited window’s functionality. In fact,
developers can manipulate hardware and
software at the same time; however, no other
programming platforms can provide such a
powerful tool for users in a windows operating
system.
Microsoft Visual C++ includes Comprehensive
debug tools.
3
Introduction
Disadvantage:
In order to monopolize computer software market, Microsoft does not
reveal the key functions to public.
Reference
Microsoft Developer Network
http://msdn.microsoft.com/
Online Help
US$3000.00 for helping in a single project
US$240.00 for a single solution
My recommendation is to learn C++ and Object Oriented
software Programming)
Computer Aided Design II (Professor M. Sid-Ahmed)
4
Outline
I. Console Application
II. Dialog Based Application
5
I. Console Application
• Start new project
6
1. Choose the project type as a Win32 console
Application.
2. Type the project name as you wish.
7
8
9
10
EXAMPLE ONE
11
II. Dialog Based Application
1.Start new project
2.Choose the project type and name
12
Start new project
13
Microsoft Fundation Class Project
•Choose Application Wizard for MFC
•Type the desire project name
14
15
CObject
CCmdTarget
CWnd
CDialog
User Dialog box
16
• CObject is the principal base class for the MFC.
• CCmdTarget is the base class for all the application
architecture classes in MFC. All classes that handle
messages are derived, directly or indirectly, from this class.
• The CWnd class provides the base functionality of all
window classes in MFC for Window programming.
• The CDialog class is the base class used for displaying
dialog boxes on the screen. (modal and modeless)
17
18
19
20
Functions
1. Switch
2. UpdateData
3. UpdateWindow
21
1. Switch
• The switch and case keywords evaluate expression
and execute any statement associated the initial
expression.
– switch( expression )
{
[case constant-expression:]
...
[statement]
...
[default:
statement]
}
22
2. UpdateData
• UpdateData function,which is a member function of CWnd,
initializes and retrieves data from a dialog box class.
• Syntax:
• BOOL UpdateData( BOOL Flag )
– Return Value is non zero if the operation is successful; otherwise 0.
• To initialize the Dialog box or any component on a dialog box, set
input argument (Flag) to FALSE.
• To retrieve Data from the Dialog box or the components on a dialog
box, set input argument ( Flag) to TRUE.
23
3. UpdateWindow
• UpdateWindow,which is a member function of CWnd,
Updates the client area of the active window.
• syntax:
• void UpdateWindow( );
24
EXAMPLE TWO
25