Condividi tramite


Preparing an Application for Distribution

This section describes a number of issues you should consider when preparing your application for deployment.

  • Selection of the Type of Build
  • Hardware, Memory, and Network Issues
  • Ensuring Correct Run-Time Behavior
  • Default Menu Options

Selection of the Type of Build

Before you can distribute your application, you must build an application file with an .app extension, an executable file with an .exe extension, or a COM component (automation server) with a .dll extension.

When you choose the type of build, consider the size of your final application file and whether your users own Visual FoxPro. The following table lists the differences between the types of builds.

Build type Characteristics
Application (.app) file Typically smaller than an .exe file (10K to 15K).
Executable (.exe) file Application includes the Visual FoxPro loader so users don't need to own Visual FoxPro. You must provide the two support files Vfp7r.dll and Vfp7renu.dll (EN denotes the English version). These files must be placed in the same directory as the executable file or along the MS-DOS path. See BUILD EXE for details about creating and distributing executables.
COM Server (.dll) files Used to create a file that can be called by other applications. In Visual FoxPro you can create two types of COM server (.dll - formerly, OLE) files. You must provide runtime support files including Vfp7r.dll, Vfp7t.dll and Vfp7renu.dll. For details, see Adding OLE.

Hardware, Memory, and Network Issues

You should consider and test the minimum environment your application can operate in, including the amount of disk space and memory. The results of your testing and the resolution of other issues covered in this section can help determine the type of build you choose, the files you include with your application, and the way you structure your distribution directory.

The applications you create have the same hardware, memory, and network requirements as Visual FoxPro. For more information on those requirements, see "System Requirements" in Installing Visual FoxPro. For additional information on creating applications for multiuser environments, see Programming for Shared Access.

Ensuring Correct Run-Time Behavior

An executable application file always checks for the presence of the Visual FoxPro run-time library, Vfp7r.dll. To run an application .exe file using the development version of Visual FoxPro, you must force the application to use the Visual FoxPro VFP7.exe file instead.

To run an executable application in Visual FoxPro

  • Start Visual FoxPro, and then from the Project menu, choose Do. In the Do dialog box, select your application's .exe file name.

    -or-

  • In the Command window, enter DO followed by the name of your application's .exe file name.

    -or-

  • In the command line that starts Visual FoxPro, specify the E switch. For example, if your application is called MYAPP, you can run it with the following command line:

    MYAPP.EXE -E
    

    This command line switch forces the application to use the executable file Vfp7.exe. For this switch to work, Vfp7.exe must be in the search path.

An application consisting only of modeless forms will not function properly in a run-time environment unless you provide a READ EVENTS command. You can ensure that the application runs properly by adding a calling program or setting the WindowType property.

To run a form in a run-time environment

  • Run the form from a program containing a READ EVENTS command.

    -or-

  • Set the form's WindowType property to Modal.

Some Visual FoxPro applications rely heavily on Visual FoxPro system menus. At run time, some menus and commands are unavailable, and without a provision for a READ EVENTS command, a menu-driven application ends as quickly as it starts. Use the following section to review any menus you include in your application.

For more information on structuring an application with the READ EVENTS command, see Controlling the Event Loop and examples of how to structure an application in Compiling an Application.

Default Menu Options

If you use the Visual FoxPro system menu, your application file includes only the following default menus and menu commands.

Menu Menu items
File Close, Save, Save As, Exit
Edit Undo, Redo, Cut, Copy, Paste, Paste Special, Select All, Find, Replace
Window Arrange All, Hide, Hide All, Show All, Clear, Cycle, all open windows
Help Contents, Search for Help on, Product Support, About Visual FoxPro

You can disable or remove any of the default menus and menu commands, or add your own menus and menu commands to run-time applications.

Tip   If your menu system works in the development environment but closes prematurely in your application, make sure you have a READ EVENTS command active while your menu system is running. Also be sure to include a CLEAR EVENTS command when you exit the menu system.

For more information about customizing menus, see Designing Menus and Toolbars.

See Also

The Distribution Process | Including Resources in Your Applications | Removing Restricted Visual FoxPro Features and Files | Distributing Applications