C++: Building an Basic Calculator Program

Author: Ronald S. Holland
at
Total Application Works

ronholland@sumtotalz.com


Tutorial: Building a Basic Calculator I Program




To visit my site

HOME] Consulting Design Maintenance Project Testing Training Turnkey Java C++ SQL HTML JavaScript C#


To contact us

© 2002 - 2013 All Rights Reserved Total Application Works


  • Tell a friend about this site (copy and paste the following HTML page into a file or send this page to a friend.)
    <html>
    <title>Example of a link </title>
    <body>
    <table border>
    <a
    href="http://www.sumtotalz.com/TotalAppsWorks/Calc_CPP/BasicCalculator_I_Tut.html">How to Create a Basic Calculator I Application </a>
    </table>
    </body>
    </html>
    Source
    Screenshot
  • On-site classes can be arranged in Java and C++. Send all inquiries to:
    RonHolland@sumtotalz.com


Read Me First

The bCalc_I_CPP.zip compressed file contains the following four files:

  1. BasicCalculator.c++ - Basic calculator source code
  2. BasicCalculator.Resource - Basic calculator resource file
  3. BasicCalculator_I_Tut.html - Basic calculator tutorial
      includes readme first description
  4. BasicCalc_help_doc - Basic calculator brief help description
  5. BasicCalculator.h
  6. BasicCalculator_ids.h
  7. BasicCalculator.VC++PROJ
  8. BasicCalculator.VC++Workspace
  9. bCalc_I_CPP.zip - this file
To run any of the projects:
  1. Go to the folder where you downloaded the bCalc_I_CPP.zip compressed file
  2. Extract the files
  3. Right clck on BasicCalculator.VC++PROJ - click on the version of Microsoft studio you have
  4. When Microsoft studio IDE is started
  5. Click on theDebug menu
  6. Click on theStart without Debugging menu
    • the Basic Calculator project will begin to execute

Introduction

This tutorial is intended for people who have some experience with C++. In this example, we will build a five-function calculator application. In order for you to follow this tutorial, you will need a copy of the Microsoft Visual Studio 2008 compiler. In addition, this tutorial assumes that you have worked through the following tutorials:

  1. Getting Started I
  2. Getting Started II
  3. Getting Started III
  4. Getting Started IV
  5. Getting Started V
In the next section, we will list the requirements for building this calculator.

Requirements

The requirements for the task are:

  1. Build a calculator application, using the CDialog class.
  2. Build a five-function calculator with the following functions:
    • Addition - adds two numbers: n1 + n2.
    • Subtraction - subtracts number two from number one: n1 - n2.
    • Multiplication - Multiplies two numbers: n1 * n2.
    • Division - divides number two into number one: n1 / n2.
    • Provide minimal error checking, in order to keep the code less complex.
  3. Use PushButtons for the numbers, functions, Exit, Help, and About.
  4. Create an event handler to respond to the events caused by the numbers, functions, Exit, Help, and About buttons.
  5. Use the MFC Basic Application Template as the basis for building this application.
  6. The calculator should look something like the following:
                       765.9
    <------------- Display box
    7 8 9 X C
    4 5 6 / CE
    1 2 3 - Exit
    +/- 0 . + =
      
    Help
      
    About
      
    Figure 1: Basic Calculator
  7. Use Holland's OOP Programming Design Model to build this calculator.

What is the Holland's OOP Programming Design Model?

In object-oriented programming, programming revolves around the data. So in this style, the top is the data. It might be depicted as follows:

Holland's OOP Programming Design Model
  
          +--------------+
          |      Data    |<----+  
          +-------+------+     | 
                  ^            |
                  |----------->+
                  V            ^
          +-------+------+     |
          |   Top-down   |     | 
          |  Structured  |<----+
          |  programming |     |
          |  on Classes  |     | (step-wise)
          |  and methods |     | (refinement)
          +--------------+     | (as needed) 
                  |            |
                  +------------+ 
 
  
Figure 2:


The data is entered in the Display box on the calculator, using the pushbuttons with numbers and/or a dot on it. This data is operated on in a binary (two numbers) fashion or in a unary (one number) fashion. The calculator operates in a

  1. binary (two numbers)
    • Multiplication
    • Division
    • Subtraction
    • Addition
  2. unary (one number) fashion
    • Plus/Minus
  3. Application functions
    • Clear
    • Clear Entry
    • Exit
  4. Equals sign displays the result of binary and/or unary operations.
  5. The pressing of the pushbuttons will result in an event handler (method) responding to the event.
    • HandleClearEntryPressed
    • HandleClearPressed
    • HandlePlusPressed
    • HandleMinusPressed
    • HandleMultPressed
    • HandleDivPressed
    • HandlePMPressed
    • HandleExitPressed
    • HandleMyHelpPressed
    • HandleMyAboutPressed
In the next section, I will describe how to build the calculator template.

Building the MFC Basic Application Template

How do we go about Building the MFC Basic Application Template. The MFC Application Template consists of four components, which are:

  1. MyAppDlg.cpp - contains the main entry point and the application's other methods.
  2. MyAppDlg.h - contains the class and variable definitions
  3. MyAppDlg_ids.h - contains the resource ID definitions
  4. MyAppDlg.rc - contains the resource definitions (e.g. push buttons)
An outline for these four components is:

   
/********************************************
 * File. MyAppDlg.cpp
 * MFC Template example
 ********************************************/

#include <afxwin.h>
#include <strstrea.h>
#include "edittext_ids.h"
#include "CEditTextDialog.h"

// Dialog constructor
CMyAppDlg::CMyAppDlg( char *lpszName )       
   : CDialog( lpszName )   // base class constructor
{
    
}

// count the characters in the edit text control
afx_msg void CMyAppDlg::OnExit()
{
   
}

BEGIN_MESSAGE_MAP( CMyAppDlg, CDialog )
   ON_COMMAND( IDC_EXIT, OnExit )
END_MESSAGE_MAP()


// The class CMyApp defines the main entry point for 
// MFC-based applications. Specifically, the InitInstance()
// method signals MFC that it is the entry point.
//
class CMyApp : public CWinApp {
public:
   BOOL InitInstance()
   {
      CMyAppDlg myAppDlg( "My app Template" );
      myAppDlg.DoModal();     // run dialog
      return FALSE;                 // finished
   }

} myApp;
  
Figure 3: MyAppDlg.cpp

   
/**************************************************
 * File: MyAppDlg.h
 *       This file contains the class and variable 
 *       definitions.
 **************************************************

class CMyAppDlg.h : public CDialog {
public:
   CMyAppDlg.h( );
   afx_msg void OnExit();     // clicked the "Exit" button

private:

   DECLARE_MESSAGE_MAP()
};
  
Figure 4: MyAppDlg.h

   
/************************************************
 * File: MyAppDlg_ids.h
 *       defines the resource identifiers
 ************************************************/

#define IDC_EXIT     2001
  
Figure 5: MyAppDlg_ids.h

   
/************************************************
 * File: MyAppDlg.rc
 *       define the MyAppDlg resources in this file
 *       The .rc defines window layouts.
 ************************************************/

#include <afxres.h>
#include "MyAppDlg_ids.h"

MyAppDialog DIALOG 50, 50, 130, 130
CAPTION "My Application"
{              resource  
                label/text           
resource type        |   resource 
      |              |   name/id     resource dimensions
      |              |       |              |    
      V              V       V              V 
   DEFPUSHBUTTON  "Exit", IDC_EXIT,  50, 100,   30,      15 
                                      x,  y,  width,   height   
                                              
}
  
Figure 6: MyAppDlg.rc

How Do We Get Started?

We will use Figure 1 above as our outline. Figure 1 consists of twenty-two push buttons and an edit box. Twenty of these buttons allow us to enter and operate on the data. In addition, Figure 1 contains an About and a Help button. We will use the above templates outlined in Figures 1 through 6.

  1. Using Figure 6, we will create an .rc file and name it BasicCalculator.rc. We will define the editbox and push button resources.

       
    /************************************************
     * File: BasicCalculator.rc
     *       defines the BasicCalculator resources 
     ************************************************/
    
    #include <afxres.h>
    #include "BasicCalculator_ids.h"
    
    CALCULATOR DIALOG DISCARDABLE  50, 50, 160, 186
    STYLE DS_MODALFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | 
        WS_VISIBLE | WS_CAPTION | WS_SYSMENU
    CAPTION "BasicCalculator"
    {
        EDITTEXT        IDC_DISPLAY,10,10,140,16,ES_RIGHT | ES_READONLY | 
                        ES_NUMBER
        PUSHBUTTON      "7",IDC_SEVEN, 10,30,20,20
        PUSHBUTTON      "8",IDC_EIGHT, 40,30,20,20
        PUSHBUTTON      "9",IDC_NINE,  69,30,20,20
        PUSHBUTTON      "4",IDC_FOUR,  10,60,20,20
        PUSHBUTTON      "5",IDC_FIVE,  40,60,20,20
        PUSHBUTTON      "6",IDC_SIX,   69,60,20,20
        PUSHBUTTON      "1",IDC_ONE,   10,92,20,20
        PUSHBUTTON      "2",IDC_TWO,   40,92,20,20
        PUSHBUTTON      "3",IDC_ONE,   69,92,20,20
        PUSHBUTTON      "0",IDC_ZERO,  40,122,20,20
        PUSHBUTTON      ".",IDC_DECPT, 69,122,20,20
        PUSHBUTTON      "=",IDC_EQUAL, 129,122,20,20
        PUSHBUTTON      "CE",IDC_CE,129,60,20,20
        PUSHBUTTON      "C",IDC_CLR,129,30,20,20
        PUSHBUTTON      "+",IDC_PLUS,98,122,20,20
        PUSHBUTTON      "--",IDC_MINUS,98,92,20,20
        PUSHBUTTON      "x",IDC_MULT,98,30,20,20
        PUSHBUTTON      "/",IDC_DIV,98,60,20,20
        PUSHBUTTON      "Exit",IDC_EXIT,129,92,20,20
        PUSHBUTTON      "+/-",IDC_PM,10,122,20,20
        PUSHBUTTON      "Help",IDC_MYHELP,46,162,24,20
        PUSHBUTTON      "About",IDC_MYABOUT,103,162,29,20
    }
    
      
    Figure 7: BasicCalculator.rc

  2. Next, using Figure 5, we will create a file to define our resource Ids and name it BasicCalculator_ids.h.

       
    /****************************************************
     * File: BasicCalculator_ids.h
     * A calculator program built using MFC CDialog class
     ****************************************************/
    
    
    #define IDC_DISPLAY 2100
    
    #define IDC_CE      2000
    #define IDC_CLR     2001
    #define IDC_MULT    2002
    #define IDC_DIV     2003
    #define IDC_MINUS   2004
    #define IDC_PLUS    2005
    #define IDC_SQRT    2006
    #define IDC_PM      2007
    #define IDC_DECPT   2008
    #define IDC_EQUAL   2009
    
    #define IDC_ZERO    2010
    #define IDC_ONE     2011
    #define IDC_TWO     2012
    #define IDC_THREE   2013
    #define IDC_FOUR    2014
    #define IDC_FIVE    2015
    #define IDC_SIX     2016
    #define IDC_SEVEN   2017
    #define IDC_EIGHT   2018
    #define IDC_NINE    2019
    
    #define IDC_EXIT    2020
    #define IDC_MYHELP  2021
    #define IDC_MYABOUT 2022
    
    
      
    Figure 8: BasicCalculator_ids.h


    Please note that each resource id has a numerical value.

  3. Next we will use b>Figure 4 as a template to define our Calculator class in file BasicCalculator.h. We must have an event handler for each button. These event handlers will be defined as methods and prefixed with an afx_msg. The afx_msg designation informs MS that this is an event handler.

       
    /****************************************************
     * File: BasicCalculator.h
     * A calculator program built using MFC CDialog.
     ****************************************************/
    
    
    const int MAX_DIGITS = 30;     // limit for display
    
    
    enum OpCode { NONE, ADD, SUB, MPY, DIV, EQ , PM , OFF};
    
    class CCalculatorDialog : public CDialog {
       public:
          CCalculatorDialog();
    
          afx_msg void HandleDigitPressed(UINT digit); // Respond to digit buttons 
                                                       //    0 to 9
          afx_msg void HandleDecPointPressed();           // Respond to . button
    
          afx_msg void HandleClearPressed();           // Respond to CLR button
          afx_msg void HandleClearEntryPressed();      // Respond to CE button
    
          afx_msg void HandleMultPressed();            // Respond to mult button
          afx_msg void HandleDivPressed();             // Respond to Division button
          afx_msg void HandleMinusPressed();           // Respond to minus button
          afx_msg void HandlePlusPressed();            // Respond to plus button
    
          afx_msg void HandlePMPressed();              // Respond to Plus/minus button
          afx_msg void HandleEqualPressed();           // Respond to equals button
          afx_msg void HandleExitPressed();            // Respond to exit 
                                                       //   application button
          afx_msg void HandleMyHelpPressed();          // Respond to Help button
          afx_msg void HandleMyAboutPressed();         // Respond to about button
    
       private:
          void clear();
          void clearEntry();
          void enter( char ch );
          void doOp();
          void showResult();
          void showEntry();
    
          double m_fResult;
          char m_szEntry[ MAX_DIGITS + 1 ];
          int m_nEntryLen;
          bool m_bHavePoint;
          OpCode m_opCode;
    
          double fEntry ;
          double fTemp  ;
    
          DECLARE_MESSAGE_MAP()
    };
    
    
      
    Figure 9: BasicCalculator.h


    In the next section, we will show how we tell MS which method is associated with which button.

  4. The data we will be working with is entered in the edit box. We must know what data is entered and a way to capture this data. Once we have the data, one or two numbers, we must have captured the operation the user wants to perform. The digits that comprise the numbers and the operations cause events to be registered when the user presses the following buttons:

    We will show the method implementation and talk about event handlers and how MS associates a button with a method in the next section.

    Event Handlers

    What are event handlers? Event handlers are methods/code that MS calls in response to an event such as the pressing of a button. MS uses the resource Id to associate a button with the event handling code. In figure 6, IDC_EXIT is the resource ID. This is how MS identifies a particular resource. We can the associate the resource Id with a method as shown in the following example.

    Button Method
        Digits 0 through 9     
     
    afx_msg void HandleDigitPressed(UINT digit);
    Decimal point afx_msg void HandleDecPointPressed();
    X afx_msg void HandleMultPressed();
    / afx_msg void HandleDivPressed();
    - afx_msg void HandleMinusPressed();
    + afx_msg void HandlePlusPressed();
    +/- afx_msg void HandlePMPressed();
    = afx_msg void HandleEqualPressed();
    along with the following functions:
          Button        
          Method        
            C       
          afx_msg void HandleClearPressed();    
    CE afx_msg void HandleClearEntryPressed();
    Exit afx_msg void HandleExitPressed();
    About afx_msg void HandleMyAboutPressed();
    Help afx_msg void HandleMyHelpPressed();
    Figure 10: Calculator Buttons
       
    MyAppDialog DIALOG 50, 50, 130, 130
    CAPTION "My Application"
    {              resource  
                    label/text           
    resource type        |   resource 
          |              |   name/id     resource dimensions
          |              |       |              |    
          V              V       V              V  
       DEFPUSHBUTTON  "Exit", IDC_EXIT,  50, 100,   30,      15 
                                          x,  y,  width,   height   
                                                  
    }
      
       
    #define IDC_EXIT     2001
      
       
                +-----------------+
                |   Resource ID   |
                +-------+---------+
                        ^
                        |
                        V 
                +-------+---------+
                ^                 ^
                |                 |
                V                 V
          +-----+-----+     +-----+-----+
          |  Resource |     |   Method  |
          +-----------+     +-----------+
          |  Button   |
          +-----------+
      
       
    BEGIN_MESSAGE_MAP( CEditTextDialog, CDialog )
       ON_COMMAND( IDC_EXIT, OnExit )
    END_MESSAGE_MAP()
      
    Figure 11: Message Map

    In Figure 11, the following occurs:
    1. IDC_EXIT - identifies the Exit push button
    2. IDC_EXIT is defined as 2001
    3. OnExit - is identified as the event handler for the Exit push button, using the IDC_EXIT resource id
    IDC_EXIT allows MS to associate the Exit push button with the OnExit event handler. This association is resolved at compiled time. The compiler resolving the push button resource with a method is similar to the compiler resolving a int a declaration with its proper attributes. We used this knowledge to assign event handlers to the resources causing the events in Figure 10: Calculator Buttons. When you view the following code:
       
    BEGIN_MESSAGE_MAP( CEditTextDialog, CDialog )
       ON_COMMAND( IDC_EXIT, OnExit )
    END_MESSAGE_MAP()
      
    the tag ON_COMMAND, when the Exit button is pressed, tells MS to go to the OnExit method. At this point, we need to add the code to respond to the event (button being pressed). An outline follows.

       
    CCalculatorDialog::CCalculatorDialog() 
        : CDialog( "Calculator" )
    {
       
    }
    
    // clear result and entry
    void CCalculatorDialog::clear()
    {
        
    }
    
    // clear entry (clears the number being input)
    void CCalculatorDialog::clearEntry()
    {
        
    }
    
    // capture the  character the user is entering
    void CCalculatorDialog::enter( char ch )
    {
       
    }
    
    // process any digit key the user enters
    afx_msg void CCalculatorDialog::HandleDigitPressed( UINT digit )
    {
        
    }
    
    // the user has entered a decimal point
    afx_msg void CCalculatorDialog::HandleDecPointPressed()      
    {
        
    }
    
    // the user has pressed the clear all data button
    afx_msg void CCalculatorDialog::HandleClearPressed()      // CLR button
    {
        
    }
    
    // the user has pressed the clear just the data being entered button
    afx_msg void CCalculatorDialog::HandleClearEntryPressed() // CE  button
    {
        
    }
    
    // the user has pressed the Multiplication  button
    afx_msg void CCalculatorDialog::HandleMultPressed()       
    {
        
    }
    
    // the user has pressed the Division  button
    afx_msg void CCalculatorDialog::HandleDivPressed()        
    {
        
    }
    
    // the user has pressed the Minus  button
    afx_msg void CCalculatorDialog::HandleMinusPressed()      
    {
        
    }
    // the user has pressed the Addition button
    afx_msg void CCalculatorDialog::HandlePlusPressed()      
    {
        
    }
    
    // the user has pressed the Plus/Minus  button
    afx_msg void CCalculatorDialog::HandlePMPressed()         
    {   
       
    }
    
    // the user has pressed the Equal button
    afx_msg void CCalculatorDialog::HandleEqualPressed()         
    {
        
    }
    
    
    // the user has pressed the Exit button 
    afx_msg void CCalculatorDialog::HandleExitPressed() {
        
    }
    
    
    // the user has pressed the Help button
    afx_msg void CCalculatorDialog::HandleMyHelpPressed() {
       
    } 
    
    // the user has pressed the About button
    afx_msg void CCalculatorDialog::HandleMyAboutPressed()  {
      
    }
    
    // Handle the previous operation, if there is one
       void CCalculatorDialog::doOp() {
          
          showResult();
       }
    
       void CCalculatorDialog::showResult()  {
         
       }
    
       void CCalculatorDialog::showEntry()   {
          
       }
    
       BEGIN_MESSAGE_MAP( CCalculatorDialog, CDialog )
          ON_COMMAND_RANGE( IDC_ZERO, IDC_NINE, HandleDigitPressed )
          ON_COMMAND( IDC_DECPT,   HandleDecPointPressed )
          ON_COMMAND( IDC_CE,      HandleClearEntryPressed )
          ON_COMMAND( IDC_CLR,     HandleClearPressed )
          ON_COMMAND( IDC_MULT,    HandleMultPressed )
          ON_COMMAND( IDC_DIV,     HandleDivPressed )
          ON_COMMAND( IDC_MINUS,   HandleMinusPressed )
          ON_COMMAND( IDC_PLUS,    HandlePlusPressed )
          ON_COMMAND( IDC_PM,      HandlePMPressed )
          ON_COMMAND( IDC_EQUAL,   HandleEqualPressed )
          ON_COMMAND( IDC_EXIT,    HandleExitPressed )
          ON_COMMAND( IDC_MYHELP,  HandleMyHelpPressed )
          ON_COMMAND( IDC_MYABOUT, HandleMyAboutPressed )
       END_MESSAGE_MAP()
    
    
       // dialog-based application
       class CCalculatorApp : public CWinApp {
          public:
             BOOL InitInstance()    {
                CCalculatorDialog basicCalcDialog;
                calculatorDialog.DoModal();   // run dialog
                return FALSE;                 // finished
             }
       } calculator;
    
      
    Figure 12: Basic Calculator Outline

    Conclusions

    In this tutorial, we have learned how to build a five function calculator application. The functions that are included in this application are:

    • Addition - adds two numbers: n1 + n2;
    • Subtraction - subtracts number two from number one: n1 - n2;
    • Multiplication - Multiplies two numbers: n1 * n2;
    • Division - divides number two into number one: n1 / n2;
    • =/- - toggles the sign of the number in the entry box.
    We used a MFC template and Holland's OOP Programming Design Model to build this application.

    Definitions

    Comment - comments help document a program but do cause the computer to perform any action. They are ignored when the program executes. They are of the form:

    • // this symbol indicates that all that follows the // is a comment
    • A multiline comment starts with /* and ends with */
      /*
       * This is a multiline comment
       */
      

    Function - a named section of a program that performs the specific task included between the { and the }.

    <iostream.h> - to declare objects that control reading from and writing to the standard streams. This is often the only header you need include to perform input and output from a C++ program.

    persistent data - is data that exists after the exit of an application or the turning off of the computer. It exists on a media storage device (e.g., hard disk).

    AFXWIN - This is a header for the Microsoft Foundation Classes C++ library. It must be included in all MFC applications.

    BEGIN_MESSAGE_MAP - Use the BEGIN_MESSAGE_MAP macro to begin the definition of your message map (declaration of event handler). In the implementation (.CPP) file that defines the member functions for your class, start the message map with the BEGIN_MESSAGE_MAP macro, then add macro entries for each of your message-handler functions, and complete the message map with the END_MESSAGE_MAP macro.

    CFrameWnd - The CFrameWnd class encapsulates the functionality of a Windows single document interface (SDI) frame window. A frame window is a window that frames an application.

    CWinApp - The CWinApp class is the base class from which you derive a Windows application object. An application object provides member functions for initializing your application (and each instance of it) and for running the application.

    CStatic - The CStatic class provides the functionality of a Windows static control. A static control is a control used to display text, to draw frames or lines separating other controls, or to display icons. A static control doesn't accept user input, but it can notify its parent of stylus taps if it's created with SS_NOTIFY style.

    CDialog - The CDialog class encapsulates the functionality of a Windows dialog box.

    dialog-based - applications that are derived from the CDialog class. The CDialog class encapsulates the functionality of a Windows dialog box.

    DEFPUSHBUTTON - The DEFPUSHBUTTON resource-definition statement creates a default push-button control. The control is a small rectangle with a bold outline that represents the default response for the user. This means that if the user presses the enter button while this button has the focus, the program will executes this button's response. The given text is displayed inside the button. The control highlights the button in the usual way when the user clicks the mouse in it and sends a message to its parent window.

    DIALOG - The DIALOG resource-definition statement specifies a window that an application can use to create dialog boxes. The statement defines the position and dimensions of the dialog box on the screen as well as the dialog box style.

    DECLARE_MESSAGE_MAP() - in the .h file, this indcates that there will be event handlers. The event handlers are defined in the .cpp file.

    event handler - an event occurs when a mouse is clicked, double clicked, a button is clicked, a key pressed, etc. Event handler is the code that is called to respond to the event, as a result of a graphical object being clicked.

    GUI - graphical user interface is a program interface that uses a computer's graphics functionality to improve the program's ease to use for the end user.

    inheritance - is the ability to create a class that derives properties from one or more base classes.

    initinstance - Override InitInstance to initialize each new instance of your application running under Windows. Typically, you override InitInstance to construct your main window object and set the CWinThread::m_pMainWnd data member to point to that window.

    message box - A message box is a special kind of modal dialog box that an application uses to display messages and prompt for simple input. A message box typically contains a text message and one or more predefined buttons.

    MENU - The MENU resource-definition statement specifies the contents of a menu resource.

    MENUITEM - The MENUITEM resource-definition statement creates a menu item.

    m_pMainWnd - Holds a pointer to the applicationís main window.

    PUSHBUTTON - resource-definition statement creates a push-button control. The control is a round-cornered rectangle containing the given text. The text is centered in the control. The control sends a message to its parent whenever the user chooses the control.

    POPUP - The POPUP resource-definition statement creates a menu item that can contain menu items and submenus.

    resource files - contains graphical window layouts.

    SS_CENTER - Designates a simple rectangle and displays the given text centered in the rectangle. The text is formatted before it is displayed. Words that would extend past the end of a line are automatically wrapped to the beginning of the next centered line.

    Template - is a unique class or pattern that can be used to build other software code.

    WS_BORDER - Creates a window that has a border.

    WS_CAPTION - Creates a window that has a title bar (implies the WS_BORDER style). Cannot be used with the WS_DLGFRAME style.

    WS_CHILD - Creates a child window. Cannot be used with the WS_POPUP style.

    WS_MAXIMIZEBOX - Creates a window that has a Maximize button.

    WS_MINIMIZEBOX - Creates a window that has a Minimize button.

    WS_MINIMIZE - Creates a window that is initially minimized. For use with the WS_OVERLAPPED style only.

    WS_POPUP - Creates a pop-up window. Cannot be used with the WS_CHILD style.

    WS_SYSMENU - Creates a window that has a Control-menu box in its title bar. Used only for windows with title bars.

    WS_THICKFRAME - Creates a window with a thick frame that can be used to size the window.

    WS_VISIBLE - Creates a window that is initially visible.




[[
HOME] Consulting Design Maintenance Project Testing Training Turnkey Java C++ SQL HTML JavaScript C#

© 2002 - 2010 All Rights Reserved Total Application Works