Partager via


Preparation for Distributing Applications

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

  • Build Type Selection

  • Hardware, Memory, and Network Issues

  • Ensuring Correct Run-Time Behavior

  • Default Menu Options

Build Type Selection

Before you can distribute your application, you must build an application (.app) file, an executable (.exe) file, or a COM component (automation server) with a .dll or .exe extension. When choosing the type of build you want to create, consider the size of your final application file and whether users have Visual FoxPro installed on their computers.

The following table lists the differences between the types of builds.

Build type

Description

Application (.app) file

This file requires that the user have a copy of Visual FoxPro installed. An .app file is usually smaller than an .exe file.

Executable (.exe) file

This file includes the Visual FoxPro loader so users do not need have Visual FoxPro installed.

You must provide the two support files VFPVersionNumberR.dll and VFPVersionNumberRENU.dll where VersionNumber represents the version number of this release of Visual FoxPro. The letters, "EN", denote the English version. These files must be placed in the same directory as the .exe file or along the DOS path. See BUILD EXE Command for details about creating and distributing executable files.

COM Server (.dll or .exe) files

This file is 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 run-time support files, including the VFPVersionNumberR.dll, VFPVersionNumberT.dll, and VFPVersionNumberRENU.dll files where VersionNumber represents the version number of this release of Visual FoxPro. For details, see How to: Add OLE Objects to Applications.

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 and the files you include with your application.

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

Ensuring Correct Run-Time Behavior

When distributing an executable application (.exe) file, you must include the following files:

  • VFPVersionNumberR.dll, where VersionNumber represents the version number of this release of Visual FoxPro.

  • VFPVersionNumberRENU.dll

  • GDIPlus.dll

  • MSVCR71.dll

In some cases, Visual FoxPro in-process servers, or .dll files, can use the lightweight VFPVersionNumberT.dll run-time library instead. For more information about run-time libraries, see VFP9R.DLL Run-Time Library and VFP9T.DLL Run-Time Library.

Note

If you want to run an application (.exe) file using the development version of Visual FoxPro, you must run the .exe file with the Visual FoxPro executable file, VFPVersionNumber.exe.

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 make sure the application runs properly by adding a calling program or setting the WindowType property.

You can also type DO followed by the name of your application's .exe file in the Command window or use the -E command-line switch in the command line that starts Visual FoxPro. 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, VFPVersionNumber.exe where VersionNumber represents the version number of this release of Visual FoxPro. For this switch to work correctly, VFPVersionNumber.exe must be in the search path.

To run a form in a run-time environment

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

    -or-

  2. 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 How to: Control 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

Tasks

How to: Include Files with Applications for Distribution

Concepts

Application Distribution Process

Distributable and Restricted Visual FoxPro Features and Files

Reference

Resource Files in Applications

Other Resources

Distributing Applications