BrainDump
  Home arrow BrainDump arrow Page 3 - AppWizard and More in MFC
Iron Speed
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Dedicated Servers 
Download TestComplete 
Windows Web Hosting
 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
BRAINDUMP

AppWizard and More in MFC
By: Gabor Bernat
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 2
    2008-03-05

    Table of Contents:
  • AppWizard and More in MFC
  • Database support, user interface, and advanced features
  • Messages and the Properties Window
  • Messages and the Properties Window continued

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    Iron Speed
     
    ADVERTISEMENT

    Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!

    AppWizard and More in MFC - Messages and the Properties Window
    (Page 3 of 4 )

    The beauty of using the AppWizard for creating the application is that it will grant you access to the override messages option. Back in the old days, a separate wizard named ClassWizard that could be called quickly with the Ctrl+W keyboard combination existed for this. If you are using a version of Visual Studio prior to the .NET platform, then this still exists.

    This option disappeared with the appearance of the .NET platform, and it was implemented in the properties tab of each class. But don’t think that the same thing can’t be done with each of them; it's just that they are located in different places. So the following part is useful for both kinds of users.

    However, I will only present the .NET version because this is more popular. Now that we created the application, all that remains for us to do is to modify where it’s appropriate. No need to write unnecessary code; heck, we only modify the part that we want to change or which message we want to respond to.

    In the previous part, I told you about the message list that we must declare and overwrite later, so here it is in real life. First, you must know that every part you see on the screen has its own class. Everything is derived from a class and has the ability to individually manage its own message list and decide what will be done with the incoming messages.

    For example, if you create a dialog box, this will be derived from the CDialog class and it will have all the functions of a CDialog. All you need to do is extend it with the specific new functions that differentiate your Dialog box from an average one defined in the MFC libraries. The story is the same if you decide to split the views. To accomplish this, you create two individual classes from the CView class and by default it inherits the properties of a view. The individualization task remains the only task for you to do.

    A view area or the dialog bar manages the messages on its own. Now when we want to modify the answer to one of the messages, we start by declaring that function in a message map. This way, in the future, at the occurrence of the message, the Dialog box’s message handler is going to know that near the standard tasks, some extra job has to be done. The message map is declared in the header file of each class; it should look something like this:

    DECLARE_MESSAGE_MAP()

    This will be followed by the declaration of the message map.

    More BrainDump Articles
    More By Gabor Bernat


     

    BRAINDUMP ARTICLES

    - Multiple Service Contracts and Indigo
    - Cleaning Out Your Programs in XP
    - Handling Metadata with Indigo
    - Building Blocks for a WCF Service Web Site
    - Help! I Need Some Remote Assistance
    - Using Service Templates with Indigo
    - Windows XP Tips for Task Manager
    - Generating Clients and Services with Indigo
    - Vista SP1, A Review
    - Services and the WCF
    - VBScript: Final Date Functions
    - Creating Services with the WCF
    - The Resource View of the MFC
    - VBScript: More Fun with the Date Functions
    - Vista Price Cuts Dissected




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway