Programming in Visual C
Programming in Visual C
TY
Programming in Visual C++
Chap 1 - Introduction
C++ is one of the powerful language due to its power & portability. It is available for
different operating system such as DOS, OS/2, UNIX, windows & many others.
C++ program when implemented under windows are called Visual C++. There is no any
difference between C++ & VC++ in terms of programming but the difference is in terms
of implementation.
A C++ compiler designed for implementation under windows is known as VC++ & A C+
+ compiler designed for implementation under DOS operating system is known simply as
C++, only environment of implemented is different. It shows in following fig.
C++ Implementation
Feature of C++
1. VC++ provides Microsoft Foundation Classes popularly known as MFC, is a C++
class library introduced by Microsoft which contains more than 200 powerful
classes that can be used for writing windows program.
2. Proper use of MFC library, reduces the length of code & development time of an
application.
3. Application Wizard provided by VC++ helps us to define the fundamental
structure of an application.
4. Database Support – You can easily connect to database & you can perform any
kind on operation on database using your program.
5. COM – Component object modeling – it is a technology introduced by Microsoft
through which code written in one language can easily be reused in another
language so you can create component based program that can easily reuse in any
program or any language.
6. Intellisence – is a particular window which help us to automatic completion of
code & also used to display properties & methods related to particular object or
windows control
Introduction to Messages.
An event is an action performed by user, an event could be keystroke, a mouse click etc.
Events are also referred to as message and can either be system defined, user defined or
application defined.
Events or messages are of three types.
1. User Defined – when user performs any action on window those are user defined
messages.
2. System defined – System can also send messages to application for example when
we shut down our system operating system send a message to every running
application for closing that application
3. Application defined – any part of application can send message to any another
part of the same or different application for example in Microsoft excel when we
A Windows Application does not receive the input directly windows operating system is
inter mediatory. Any number of applications can be open simultaneously on windows. In
put from user may be directed at any one of these application.
Any input is directed to a particular window by windows operating system in the form of
message.
Windows operating system organizes or stores messages in queue, so that they can be
processed in an FIFO or orderly manner.
Windows Message queue are as follows.
1. A Main System queue for the message for all the open windows.
2. One message queue for each window that is open.
Input
Windows removes the message from the message queue & examines it to determine the
destination window
Windows send the message from the system message queue to the message queue of
destination window.
The Window or application removes a message from its message queue and responds to
it.
Message map is table or method which maps windows message to appropriate message
handler.