( Index )
Month

Brief Information about the Oct '07 CSIG Meeting

Process Whois (Advanced)

C++ Version 7 and Visual Studio 2005

Written by B. Arnold

Process Whois Snapshot

Welcome to the CSIG, a Special Interest Group of the ACGNJ. We will be discussing Windows Programming using Visual C++ 2005 from Microsoft.

Again, let me welcome everyone back from their Summer activities.

The subject for this month is a more deluxe utility for processing raw text data. The utility provides information to a client about their web site usage. It is a continuation of last months program but with some deluxe features. Reading the introductory text in the above screen shot will give you the idea. The code uses the latest C++ compiler in Microsoft's Visual Studio 2005 so there are many discussion points and C++ changes. The program may also be compiled using the free C++ Express compiler. Some of the items that we will discuss are as follows.

Windows Programming with Microsoft Managed code
Accessing data on a web site
Microsoft Visual Studio 2005
Debugging
Text Processing and Storage
Internet Whois
The Windows Clipboard

Text processing is an area that C++ programs shine above all other languages. The code produced is usually quite compact and ultra fast. Last year I wrote a program for doing text replacement in a data file. The user had to convert extra characters from a Mainframe dump into readable text. The source was a 10 Megabyte text file and the processing took about 1 hour of actual computer time to accomplish the replacement using Notepad. The operation was repeated daily. My program, using normal C++ functions, took about 20 seconds! The user was dumbfounded.

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 and the "Express" versions are free ! I see also that Microsoft is advertising a still newer version, Visual Studio 2008 Beta. Additionally, there are other companies making free and almost free compilers. Here's a link with many compilers: http://www.willus.com/ccomp.shtml

Microsoft .NET Framework Version 2.0

This is a large package, about 24 Megs. Most people running updated versions of WinXP will already have it on their computer. If not, it may be downloaded from Microsoft.

Here's the download address for the Microsoft Framework:
Microsoft Software
Or, just look for: Microsoft .NET Framework Version 2.0 Redistributable Package (x86)

There are a number of ways to refer to this compiler and code.

The beginning of the evening (starting at 7:30pm) will be a RANDOM ACCESS discussion. The main presentation will discuss the program.

Our download site has code and programs from most of our meetings. ( Source Code Files )

Sample Code - VC7

Sample Code
===========
        // The user clicks the "Process Data" button to perform data calculations.
        //
    private: System::Void Process_Click(System::Object^  sender, System::EventArgs^  e) {
                 if (LineArray->Length == 0) return;
                 Array::Resize(SummaryArray, 0);        // Clear
                 for each ( String ^ La in LineArray )
                    {
                        // System.Text.RegularExpressions.RegEx.Split 
                        Regex ^ re = gcnew Regex(",");
                        array<String ^>^TokenArray = re->Split(La);     // Split history line into tokens.
                        if (TokenArray->Length != 6) continue;

                        bool found = false;
                        if (SummaryArray->Length > 0)
                            for (int i=0; i<SummaryArray->Length; i++)  // scan each record
                            {
                                if (SummaryArray[i]->ip == TokenArray[IP])
                                {
                                    SummaryArray[i]->BumpCount();
                                    SummaryArray[i]->date_max = TokenArray[DATE];
                                    SummaryArray[i]->visit_max= TokenArray[VISIT];
                                    found = true;
                                    break;
                                }
                            }
                            if (!found) // add more data to the SummaryArray
                            {
                                int idx = SummaryArray->Length;
                                Array::Resize(SummaryArray, idx+1);
                                SummaryArray[idx] = gcnew Record();
                                SummaryArray[idx]->date =       TokenArray[DATE];
                                SummaryArray[idx]->visit =      TokenArray[VISIT];
                                SummaryArray[idx]->ip =         TokenArray[IP];
                                SummaryArray[idx]->town =       TokenArray[TOWN];
                                SummaryArray[idx]->state =      TokenArray[STATE];
                                SummaryArray[idx]->country =    TokenArray[COUNTRY];
                                SummaryArray[idx]->count =      "1";
                                SummaryArray[idx]->date_min =   TokenArray[DATE];
                                SummaryArray[idx]->date_max =   TokenArray[DATE];
                                SummaryArray[idx]->visit_max =  TokenArray[VISIT];
                            }
                    }
                 DisplaySummary();
             }

"Random Access" questions start at 7:30 Tuesday night.

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