Microsoft KB Archive/104326

{| = Considerations for Creating Cross-Platform Applications =
 * width="100%"|

ID: Q104326

2.50 2.50a | 2.50 2.50a

MS-DOS    | WINDOWS kbinterop kbtool kbprg The information in this article applies to:


 * Microsoft FoxPro for MS-DOS, versions 2.5 and 2.5a
 * Microsoft FoxPro for Windows, versions 2.5 and 2.5a

SUMMARY
You can create applications and programs that can be executed by all FoxPro products; for example, you can create a screen in FoxPro for MS-DOS that can be executed in FoxPro for Windows. Below are some special considerations for these cross-platform applications.

MORE INFORMATION
In order to run a FoxPro application on a different platform, you must purchase the development version for that platform. For example, an application developed in FoxPro for MS-DOS cannot be run in FoxPro for Windows unless you first purchase the development version of FoxPro for Windows in order to run the program. When you are creating and distributing .FXP, .APP, and .EXE files, you must purchase both the development version and the Distribution Kit for every platform the application will be run on.

If an API library (an external library, created using Microsoft C/C++ version 7.0 or later or WATCOM C compiler 8.5 or later) is used, only one copy of the FoxPro Library Construction Kit is needed; however, the library should be compiled into both a .PLB (MS-DOS-style library) and an .FLL (Windows-style library). Likewise, only one copy of the FoxPro Connectivity Kit is needed for both the MS-DOS and Windows products.

Due to the differences inherent in various platforms, some commands are not available on all platforms. For example, the Windows version of FoxPro can take advantage of various fonts and can place objects according to precise pixel locations, but this is not possible in the MS-DOS version. For screens to be ideally transferable, this difference must be taken into consideration. It is therefore advantageous to double-check if a command is valid on any other platforms the application may eventually be run on.

The system variables _DOS, _WINDOWS, _MACINTOSH, and _UNIX are designed to provide a programmatic method of customizing code specific to a platform. By using an IF ... ENDIF or DO CASE ... ENDCASE structure, a portion of code can be written in a platform-specific manner, while the majority of code applies to all platforms.

Although source code is applicable to all platforms, the object (compiled) code may not be. Therefore, it is best to recompile a program before running it on another platform. When you are dealing with the FoxPro generators (the Screen Builder, Report Writer, and Label Designer), remember that not all changes are automatically reflected on a different platform. To view the changes, transport the file before executing it.

For more information, refer to the references listed below.