Installing/Configuring Visual FoxPro 9.0
by Dennis Allen
Upgrading FoxPro 2.6a code to Visual FoxPro 6.0 is not that difficult. For the most part, FoxPro for Windows code is compatible with Visual FoxPro code (see Visual FoxPro 6.0). This tip sheet was created to cover some of the extra steps needed to go to Visual FoxPro 9.0.
FYI: If this sheet doesn't answer your question, check one of the Visual FoxPro forum web sites listed here. For the latest FoxPro bug listing, click here.
All information contained on this sheet is provided as is. There are no warranties, expressed or implied. The author and contributors may not be held liable for any damages, including any lost profits or other incidental or consequential damages arising out of or inability to use this information. Use of this information constitutes acceptance of this disclaimer. You should always double check any information before acting upon it.
This sheet contains references and/or links to other sites or to third party suppliers of goods and/or services. Such references or links should not be considered as an endorsement by the sponsors of this web site.
Visual FoxPro 6.0 programs will recompile to Visual FoxPro 9.0. You may, however, have to adjust your code to handle Visual FoxPro 9.0. The following describes some of these changes:
_screen.Themes=.F.
Controls defined using @...GET or @...SAY and similar @... commands are not compatible with Windows XP Themes. Therefore, when running programs written with FoxPro 2.x on Windows XP or later, you should set the _SCREEN.Themes property to False (.F.); otherwise, the controls on the forms disappear.
In turning off themes, however, I found a bug in Visual FoxPro 9.0, illustrated in the following code:
DEFINE WINDOW TEMP FROM 0,0 TO 24, 78 COLOR W/B FLOAT CLOSE GROW ZOOM
SYSTEM
DEFINE WINDOW TEMP2 FROM 4,0 TO 24, 78 COLOR W/B FLOAT CLOSE GROW ZOOM SYSTEM
ACTIVATE WINDOW temp
@ 0,0 SAY 'Hi'
USE mail
BROWSE WINDOW temp2 IN WINDOW temp
RELEASE WINDOW temp
RELEASE WINDOW temp2
If you add _screen.Themes = .F., the color in window temp becomes affected but only the first time you run the code. Run it again, it's fine. There's been several attempts to fix this problem, click here for the thread. I've found the best solution is to perform a quick browse at the beginning of my application, before I set my color sets. Example:
IF "FoxPro 09" $ VERSION()
cD = "_screen.Themes = .F."
&cD.
SELECT 0
USE TEMP ALIAS TEMP SHARED
DEFINE WINDOW TEMP AT 1,1 SIZE 3-1-1,3-1-1 CLOSE
CLEAR TYPEAHEAD
KEYBOARD CHR(27) PLAIN
BROWSE WINDOW TEMP
USE
RELEASE WINDOW TEMP
ENDIF
Calculator/Calendar/Filer
As an programmer, I missed some of the old FPW 2.6 sysmenu functions. Well, you can get them back in 9.0. In your startup directory, add the following to your config.fpw file:
COMMAND = DO VFPSTART
To your vfpstart.prg file, add the following code:
DEFINE BAR 16 OF _mwindow PROMPT "\-"
DEFINE BAR 17 OF _mwindow PROMPT "Ca\<lculator" MESSAGE "Perform calculations"
ON SELECTION BAR 17 OF _mwindow ACTIVATE WINDOW CALCULATOR
DEFINE BAR 18 OF _mwindow PROMPT "Calendar/D\<iary" MESSAGE "Check dates and keep track of appointments"
ON SELECTION BAR 18 OF _mwindow ACTIVATE WINDOW CALENDAR
DEFINE BAR 19 OF _mwindow PROMPT "\<Filer" MESSAGE "Manage files and directories"
ON SELECTION BAR 19 OF _mwindow DO FORM (HOME()+"tools\filer\filer")
SET SYSMENU SAVE
Color Sets
If you are still using foxuser.dbf colorsets, you may need to tweek them. In color scheme 1, the color pairs 9 and 10 are designated FoxPro for DOS only. Visual FoxPro 9.0, however, uses them so you may need to adjust them. The color background W* (bright white) also appears broken, so use W+ instead. You can find Visual FoxPro 9.0 foxuser.dbf colorsets for my freeware applications, here.
Compiling Code
I recommend recompiling your Visual FoxPro 6.0 programs for Visual FoxPro 9.0. While Visual FoxPro 6.0 FXP/APP files are mostly compatible with 9.0, I've seen instances where it wasn't the case.
Note: When compiling an EXE file, Visual FoxPro 9.0 doesn't always delete associated FXP file.
Note #2: Sachin Sharma had a situation where code is behaving differently when compiled into an executable. See VFP Executable. Problem distilled down to a DEFINE WINDOW A FROM -150,0 TO 500,150. DEFINE WINDOW positions the window based on the parent window font size. So first try to explicitly define the font and font sizes in your windows definitions and in _screen. Otherwise, you'll have to code around the problem:
IF "RUNTIME" $ UPPER(VERSION()) .OR. "EXE" $
UPPER(VERSION())
ELSE
ENDIF
FOXUSER.DBF
Visual FoxPro 9.0 doesn't recognize many of your saved 6.0 settings, so you may have to reset them in 9.0. For example, in my applications I go in View->Toolbars and turn off the standard toolbars.
SET CPDIALOG OFF
By default, Visual FoxPro prompts you with a code page dialog box whenever it opens a dbf file without code page. To turn it off, add SET CPDIALOG OFF to your config.fpw file.
SYSMENU
If you create a customized sysmenu, system variables _mtl_spell and _mwz_setup no longer exist in Visual FoxPro 9.0.
Task Pane Manager
If you're like me, you can't stand the task pane manager. After installing and launching VFP 9.0, the task pane manager tries to run and hangs. It might be looking for MSXML 4.0 Core Services. It might have been trying to access the Internet and won't quit until it does.
When I tried disabling the task pane manager, I had to click/defocus/focus on the manager until I got to task pane options. Under task pane options, task pane manager, I deselected "open the task pane manager when Visual FoxPro starts".
You can also remove the task pane manager via Tools > Options > File Locations (tab) > Startup Program (scroll down). Highlight Startup Program and click the modify button. Remove "..\microsoft visual foxpro 9\taskpane.app", click "OK", then click the "Set As Default" button.
For more taskpane manager tips, visit Microsoft FoxPro forum,
People always ask me where to purchase a copy of Visual FoxPro. You might try
either ebay.com or amazon.com.
Keep checking the ebay stores. Copies float on and off that site all the time. Also try
EMS Professional Software.
After installing Visual FoxPro 9.0, it's a very good idea to install the latest service patch. Microsoft still offers VFP 9.0 SP2, here. The SP2 patch should take you to Visual FoxPro 09.00.000.5815.
There are three hotfixes for SP2: KB948528 deals with SDI forms, KB952548 handles browsing child/parents tables, and KB968409 which handles data group headers/footer in the report writer. Hoxfix KB968409 includes hotfixes KB948528 and KB952548. Although Microsoft no longer offers hotfixes, you can still download KB968409 from here. Once you've downloaded and extracted KB968409, move the resulting files to their appropriate folders:
c:\program files\Microsoft Visual foxpro 9\Vfp9.exe
c:\program files\common files\merge modules\Vfp9runtime.msm
c:\program files\common files\microsoft shared\vfp\Vfp9r.dll
c:\program files\common files\microsoft shared\vfp\Vfp9t.dll
Hotfix KB968409 should take you to Visual FoxPro 09.00.000.7423
I hope you have found this tip sheet useful. If you have a tip to add, drop me an email (
[Return to Top]
[Go to Home Page]
Copyright © 2013 Dennis Allen.
This web page was last updated 03/19/15