Our bank is running a Microsoft FoxPro for Windows custom application, and the performance is awful. We have to try several times before the application will start. We also get a Divide-by-Zero/Overflow error. We found foxpfix.exe, and it's enabled.
FoxPro for Windows doesn't perform like a true Windows application because it doesn't use the basic Windows API. It acts more like a 16-bit DOS application. You can use Citrix's foxpfix.exe utility to fix some of the graphics problems, but you still need to tame foxr.exe using application tuning. Foxpfix.exe is enabled by default, but I find that it's often better to disable it.
Here are some tips for tuning the application. You'll need to use Performance Monitor to adjust these hexadecimal numbers according to your needs, but the settings are usually close for most applications.
Using regedt32.exe, create the subkey
HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows NT/CurrentVersion/Terminal Server/Compatibility/Applications/foxr
With a "d word," create the values
Flags = 0 x C FirstCountMsqQPeeksSleepBadApp = 1F MsgQBadAppSleepTimeInMillisec = 0 x 1 Nthcountmsgqpeeksleepbadapp = F
One mistake I've seen is that people tune the compiled application name (e.g., account.exe) instead of foxr.exe. Tuning account.exe does nothing— foxr.exe is the problem application.
To tune the memory, create a foxpro.pif or shortcut file that calls a unique config.nt file. You can copy the system config.nt to the application directory and add mem=60 1024,8192. The addition sets FoxPro to use up to 60 percent of the available memory— not less than 1024K and not more than 8192K.
Here are few tips for your FoxPro programmers:
- Keep screens as simple as possible; limit colors and color changes.
- Limit your screen changes to 25 percent of the total screen.
- Don't overrun the area you're working in. If you're working with a 640 x 480 resolution screen, don't let any of your screen displays exceed this area
The Divide-by-Zero/Overflow error is a known problem that occurs on any Pentium II or greater machine with a 333MHZ or faster processor. The processors have trouble starting some 16-bit programs, including FoxPro for Windows. It seems that Windows NT 4.0, Terminal Server Edition (TSE) intermittently expects a program to load before it actually does. You can find some third-party fixes. Microsoft addresses the problem in Microsoft Support Online article Q240982.