3rd Tuesday of the month. 7:30PM - C/C++ Group, SPRS
Welcome to the CSIG, a Special Interest Group of the ACGNJ. This group is a "Special Interest Group" of the ACGNJ devoted to discussing programming languages in general and C, C++, and C++ for Windows programming in particular. Each month a small but hopefully useful program (complete with source code) is presented for discussion.
Since there have been so many changes in the Browser program that I started in March, we will discuss the features in Microsoft Visual Studio 2005 which enabled the creation of this program. In addition to its test capability, the browser is also quite useful as a normal Internet Browser. The application program demonstrates the ability of the Visual Studio software to include an Internet browser window inside a standard C++ program. It allows creating a custom browser with special features.
During the meeting we will discuss the techniques in programming that allow the creation of a vast number of "Event Handlers" that do not appear in the development enviornment editor (IDE). This methodolgy allows using virtually all of the internal and hidden functions and methods of the new .NET Microsoft classes. For example: In the program, I wanted to grab the event "Can Go Back Changed" which is used to enable or disable the "Back" button or arrow. This was not available in the IDE. By coding it manually, I was able to use its functionality. I will discuss more on this at the meeting.
Here are the latest additions and changes (Version 1.10 March 30, 2007)
This application is designed to partially duplicate the functioning of a standard Internet browser. It may be used whenever diagnostics and/or extra safety is required. In order to go to a web site, just type the name in the Address bar at the top. A shortcut with that name as an argument may also be used. The Back Arrow (upper left) allows stepping backwards to sites already visited. Standard Hot Keys are provided: Ctrl-P for printing, Ctrl-C for copying, Ctrl-A for selecting all, and Ctrl-F for finding.
Whenever a new address is provided, or the site code tries to jump to
another site, a prompt message appears which allows the user to decide
whether to proceed or not. The parachute logo represents the fact that you
have much more control over your browsing. You will probable find it
surprising that familiar web pages are so complicated. Often going to one
page launches 5 others in the background without your realization. Tip: for
safe web sites, just hit the Space Bar.
Here's an example of what you might see ...
The program may be compiled using the C++ .Net compiler included with Visual Studio 2005 as well as the free (!!!) C++ Express compiler. Additionally, since C++ has many similarities with C# or C-Sharp, these compilers may also be used with modifications to the source files. Microsoft provides a C-Sharp compiler with Visual Studio 2005 as well as the free (!!!) C-Sharp Express compiler. Be sure to bring questions about the code and the language.
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:There are a number of ways to refer to this compiler and code.
At the meeting on Tuesday night we will be discussing these items and more.
Sample Code =========== public ref class Form1 : public System::Windows::Forms::Form { public: Form1(void) { InitializeComponent(); // //TODO: Add the constructor code here // this->web1->CanGoBackChanged += gcnew System::EventHandler(this, &Form1::web1_CanGoBackChanged); this->web1->CanGoForwardChanged += gcnew System::EventHandler(this, &Form1::web1_CanGoForwardChanged); Backup->Enabled = false; Forward->Enabled = false; argv = Environment::GetCommandLineArgs(); argc = argv->Length; FilterList->Visible = false; HistoryList->Visible = false; Tip1->ShowAlways = true; Tip1->SetToolTip( this->Backup, "Go to previous page." ); Tip1->SetToolTip( this->Forward, "Go to next page." ); Tip1->SetToolTip( this->FilterButton, "Disallow web sites." ); Tip1->SetToolTip( this->GoButton, "Go to new web site." ); Tip1->SetToolTip( this->HistoryButton, "Display all sites visited." ); Tip1->SetToolTip( this->Address1, "Current or Future web page." ); Tip1->SetToolTip( this->ByPassBtn, "Bypass all user prompting." ); IntroMsg->Text = INTRODUCTION; Show(); // Astronomy Picture of the Day // ============================ if (argc < 2) web1->Navigate("http://antwrp.gsfc.nasa.gov/apod/astropix.html"); else { String ^foo = argv[1]; for (int i=2; i<argc; i++) foo += " " + argv[i]; pictureBox1->Visible = false; // Turn off splash IntroMsg->Visible = false; // Ditto web1->Navigate(foo); } } array <String^> ^argv; int argc; static int NewWindowCancels = 0; static bool NoNewWindows = false; static bool ByPassFlag = false; static bool Address1_FocusEnter = false;