( Index )
Month

Brief Information about the June '09 CSIG Meeting

Fun with C++ Classes
B. Arnold

People

Welcome to the CSIG, a Special Interest Group of the ACGNJ. This is an exciting time for the C Language programming since Microsoft now has 4 different language compilers: C++, C++ Express, C-Sharp, and C-Sharp Express. These are all capable of creating Windows (tm) programs. (Some are FREE!)

Here's a brief synopsis of the coming meeting:

Object Oriented Programming (OOP) languages like C++ have special characteristics. Two very important ones are "Inheritance" and "Polymorphism". We will concentrate on a program that uses the first of these, Inheritance. A simple example that demonstrates the feature will be presented. While the program is simple, the application of the concept cannot be underestimated. As can be seen in the above graphic, the program creates hundreds of images in only a second. These images can be dealt with as high level objects with all of the details hidden, or they can be dissected by the programmer down to the finest detail. Both options are available. The same concept can apply to an automobile database as to a cartoon face.

(Note: this is the last C++ meeting until after Labor Day.)


There are a number of ways to refer to Microsoft's latest compilers and code. Here's what Wikipedia says: The Common Language Infrastructure (CLI) is an open specification developed by Microsoft that describes the executable code and runtime environment that form the core of the Microsoft .NET Framework. The specification defines an environment that allows multiple high-level languages to be used on different computer platforms without being rewritten for specific architectures.

Microsoft .Net Framework 3.5
C++ 9.0
.Net 3.5
CLI
Common Language Infrastructure
Managed

Sample Code

//  PERSON.H        ACGNJ C++ MEETING JUNE 16, 2009 - WRITTEN BY BRUCE ARNOLD

#pragma once

ref class Person : public RoundFace
{
            // Note the keyword 'new'. It informs compiler that this Paint method
            // can be used in addition to the Paint method of the parent.
public:
    void Paint(System::Windows::Forms::PaintEventArgs^  e) new ;
};



//  ROUNDFACE.H     ACGNJ C++ MEETING JUNE 16, 2009 - WRITTEN BY BRUCE ARNOLD

#pragma once

#include "HeadObject.h"

ref class RoundFace : public HeadObject
{
public:
    void Paint(System::Windows::Forms::PaintEventArgs^  e) ;
};



// HEADOBJECT.H     ACGNJ C++ MEETING JUNE 16, 2009 - WRITTEN BY BRUCE ARNOLD

#pragma once

    using namespace System::Drawing;

ref class HeadObject
{
public:
    int cx, cy, x, y;
    Brush ^background;
    HeadObject(void);
    void Position(int xx, int yy);
    void Shape(int width, int height);
    void BkGround(Brush ^cc);
};

SOURCE CODE

Source Code Files

For help, email me at b a r n o l d @ i e e e . o r g
Back to C++ Main Page