VPM Enterprise Main Application Program

The functionality in the VPM Enterprise Main Application Program is executed in the sequence listed below. Become familiar with this sequence so that youíll know where to make modifications when you need to do so.

∑       The application object is instantiated from the ProApp class.

∑       The Startup method of the application object is run. The Startup method in turn runs other methods of the application object that perform the functions listed below that are necessary to initialize an application.

Tip: The code that performs the functionality listed below is in methods of the VPMApp class in the VPMApp class library. Method names are shown.

∑       InitializeProperties: Properties are initialized.

∑       SaveEnvironment: Saves environment settings so that they can be restored when the application is exited.

∑       IssueOnError: Invokes the initial error handler. If an error occurs prior to the user gaining access to the application, the error handler will make sure the application is exited.

∑       SingleInstance: Determines if this instance of the application should be allowed to be launched. If the SingleInstance_lOnlyOneInstanceAllowed property is set to .T. (the default), only one instance of the application can be running at any given point on a particular PC.

∑       SetClassLib: Opens the visual class libraries containing class definitions.

∑       ReleaseToolbars: Hides any VFP toolbars that might be visible.

∑       CloseProjectManager: Makes sure that the VFP Project Manager is not open.

∑       RegisterDLLFunctions: Registers the Dynamic-Link Libraries (DLL) functions used in the application.

∑       ModifyMainVFPWindow: Modifies the main Visual FoxPro window.

∑       SetInitialEnvironment: Sets up the basic environment for a VFP application.

∑       InstantiateMessagingObject: Instantiates the Messaging object.

∑       IssueOnShutdown: Issues the applicationís ON SHUTDOWN command.

∑       LoadArray_DriveSwapping: Loads the Drive Swapping array that provides for the swapping of drive designations so that they are correct for the PC that is running the application. The array is loaded here when the swapping is not dependent on the PC on which the application is being run.

∑       SetEnvironment: Sets up the environment specific to the application. This includes setting the VFP path and issuing the SET commands.

∑       InstantiateSessionObject: Instantiates a Session object to create a private data session where tables and views can be opened.

∑       InstantiateDataHandlerObject: Instantiates the data handler object that is used by methods of the application object that deal with data.

∑       InstantiateInternationalObject: Instantiates the International (multilingual) object.

∑       OpenAtStartup_PDS: Opens the data dictionary, message, security, and multilingual view cursors that will remain open while the application runs.

∑       InitialLanguage: If using the multilingual functionality, prepares the application to use the initial language.

∑       LoadArray_AdminTools: Loads the array that identifies whether each Administrative Tool is turned on or off.

∑       DefineFunctionKeys: Defines the function keys

∑       DisplayLogo: Displays the logo and copyright notice.

∑       InstantiateSecurityObject: Instantiates the Security object.

∑       PerformUserAccessSecurityCheck: Runs the Login form.

∑       LoadArray_DriveSwapping: Loads the Drive Swapping array that provides for the swapping of drive designations so that they are correct for the PC that is running the application. The array is loaded here when the swapping is dependent on the PC on which the application is being run

∑       RunIntroductoryForm: Runs the Introductory form.

∑       RunMainMenu: Runs the applicationís main menu.

∑       InstantiateApplicationToolbar: Instantiates the application toolbar.

∑       InstantiateStartupToolbar: Instantiates the startup toolbar.

∑       PerformStartupAction: Performs the startup action (run program, etc.).

∑       RunTipForm: Runs the Tip of the Day form.

∑       RunAdminTool: Creates an Activity record to log the userís entry into the application.

∑       IssueOnError: Invokes the permanent error handler.

∑       Starts the VFP event processing (issues READ EVENTS command).

Session Object

At application startup, a Session object (InstantiateSessionObject method) is created and system views are opened in the Session objectís private data session (OpenAtStartup_PDS method).

∑       InstantiateSessionObject: At application startup, the Startup method calls the InstantiateSessionObject method. In this method a Session object is instantiated to create a private data session where certain system views can be opened and left open the entire time the application is in use.

∑       OpenAtStartup_PDS: Later in the Startup method, the OpenAtStartup_PDS method is run. In this method the data dictionary, message, security, and multilingual view cursors that will remain open while the application is running are opened. Leaving the cursors open reduces network traffic and connection use as well as speeds up access to frequently used information.

Tip: You can use the following application object methods to access records in the system view cursors that remain open: GetDDD, GetDDTV, GetDDF, GetDDIT, GetMessageRecord, and GetSecRecord. The method name tells you which view cursor a method accesses. See VPMApp Class Methods for descriptions of these methods.

More:

Application Class