Step 3.)

Add "Nag" features to program 

If the user is not registered, then we will cause the About dialog to display for 5 seconds. 

a) The AppWizard places the class declaration for CAboutDlg in the VCRedReg.cpp file. This will cause a problem later on, so move the declaration to the file VCRedReg.h.

b) Add the following function declaration to the class CVCRedRegApp:

private: 
    void AboutNag();

c) Some of the methods used in the implementation have not been written yet, but will defined in the next section. Add the function implementation to the file VCRedReg.CPP as follows:

    void CVCRedRegApp::AboutNag() 
    { 
    CAboutDlg dlgAbout;        

        if
( !m_bRegistered ) { 
            dlgAbout.IsRegistered(m_bRegistered);
            dlgAbout.SetNagTimer(5); // Have it display a 5 sec nag 
            dlgAbout.DoModal();
            m_bRegistered = dlgAbout.IsRegistered(); 
        }
    }


    Back            Next