Copyright: Shareware Reminder Component Help


Shareware Reminder Dialog Component: Overview

The Shareware Reminder Dialog component adds a reminder dialog to your application to remind users to register their copies of the software. This is useful if you plan on distributing your application as shareware. You can also enforce a usage limit on demonstration copies of your application.

When you insert this component, one C++ class and one dialog resource will be inserted into your project. By default, the reminder dialog resource contains an edit control and two push buttons. The edit control displays the reminder text. One push button, named Continue, dismisses the dialog, while the other, named How to Register, displays information on how the user can purchase your software.

Shareware Reminder Dialog Component: Specifics

Shareware Reminder Dialog Component: Results


Shareware Reminder Dialog Component: Specifics

Follow the steps below to use this component:

1.	Select whether you want to enforce a usage limit for your application.

2.	Specify the name of the dialog class for the reminder dialog, and the names of the files in which to place the source code.

3.	Read the summary of the changes that will be made to your project, and click the Finish button to make the changes.

Once you have added the reminder dialog, you must customize its appearance and behavior. You must, at a minimum, change the dialog’s caption, the text displayed, and define the behavior for the How To Register button. Your How To Register button could display another dialog or open your registration form using a text editor, depending on your specific situation.

Usage Limit Enforcement

When you insert the reminder dialog component into your project, you are asked whether you wish to enforce a usage limit for your program.  If you choose to have no usage limit, the application will display the reminder dialog every time it’s invoked.

If you choose to enforce a usage limit, then a running count of application launches is maintained in the Windows registry. Once the usage count exceeds the set limit, the application will immediately terminate after displaying the reminder dialog.

By default, this running usage count is stored in the sytem registry under HKEY_LOCAL_MACHINE\SOFTWARE in a subkey with the application’s name.  If you want to keep clever users from “cheating” and manually resetting this usage count, you can either hide the value in a more obscure location in the registry, or find other ways of hiding it (for example, with a hidden file in the windows directory).

Conditional Compilation of Reminder Dialog Code

It is likely that you will have one “unregistered” version of your application which displays the reminder dialog at startup, and another “registered” version which does not display the dialog.

In order to remove the reminder dialog from the registered version, you can use conditional code and resource compilation to strip out the reminder dialog’s code and resources under a particular project configuration.

In the implementation file for the reminder dialog (named “ReminderDlg.cpp” by default), the code is compiled only if the symbol “REMINDER_DLG” is defined. The class declaration in the header file is similarly protected. By default, the symbol “REMINDER_DLG” is explicitly defined in these files so that you can use them right away, but you can remove the “#define REMINDER_DLG” statement at the top of these files and insert them into your project’s compiler settings for only the appropriate configurations.

To conditionalize the resource for the reminder dialog:

1.	Open the dialog resource in the Visual C++ dialog editor.

2.	Open its property page (using ALT+ENTER).

3.	Set the “Condition” field to be REMINDER_DLG.


Shareware Reminder Dialog Component: Results

The Shareware Reminder Dialog component makes the following changes to your project.

•	A C++ class is added to your project, defined in a separate .H and .CPP file.

•	A dialog resource is added to your project.

•	The InitInstance function of your application class is modified to display the reminder dialog at startup.


Shareware Reminder Dialog Component: Usage Limit Page

Choose whether to enforce a usage limit of your application, and if so, what the limit should be. This allows you to restrict the number of times that your application is launched (if, for example, you want to distribute a demonstration copy of your software).

If you want users to be able to be able to run your application indefinitely, choose “No Usage Limit.” If you want users to be limited to a specific number of startups, choose “Enforce Usage Limit”. You can also change the default value of 20.


Shareware Reminder Dialog Component: Class Page

Choose the class name for your new dialog class, as well as the names of the header and implementation files used for this class. To change any of these names, you may simply change the text in the edit box. You can also use the “Change” button next to either filename to browse through the file system.


Shareware Reminder Dialog Component: Summary Page

This page displays a summary of the changes that the Shareware Reminder Dialog component will make to your project if you press the Finish button. You can press Cancel to abort, or press the Back button to make changes to your selections.


Shareware Reminder Dialog Component: Change Files

Use the Change Files dialog box to change the name of the header and implementation files of the helper functions.

Header file   Use this control to change the name of the header file.

Implementation file   Use this control to change the name of the implementation file.

Browse   Displays a dialog box for selecting a new drive and/or directory for the location of the header or implementation file.