Kevin Ragsdale: Visual FoxPro 9.0

Lose THE FoxPro

There are several ways to “Lose THE FoxPro” (or, remove all references to Visual FoxPro) in our apps:

  1. Get rid of the Microsoft Visual FoxPro caption on your app title bar
    If you use a Top-Level form as the main window for your application, this is easy: simply set the form Caption property to the name of your app. Some people who use the VFP _SCREEN as the main window set the value for _SCREEN.Caption to the app name somewhere in their startup code, but this can cause the main window to load with “Microsoft Visual FoxPro” as the caption before the caption is updated to your apps name. For this reason, I recommend adding the following line to the app CONFIG.FPW file and including it with the build (replace TheNameOfTheApp with the actual app name): TITLE = TheNameOfTheApp
  2. Make sure your icons aren’t the “Fox Head” or the “Windows” icon
    This is easy as well. You can attach an icon to your Project via the Project Info dialog in the Visual FoxPro IDE. This icon will be used as the display icon for your EXE in Windows Explorer, and also as the icon for the apps main form (unless you choose a different icon for the form). While you’re at it, be sure to assign an icon to the icon property of every form in the app. This prevents all of your secondary forms from having the “Windows” icon. Not good with creating icons? I recommend Axialis IconWorkshop, which just happens to be on sale until December 31st.
  3. Trap unhandled errors and report them as an application error, not a “Visual FoxPro” error
    Error handling is more important than ever if you want to make sure your users do not see a message about “Visual FoxPro”. I’ve been using a modified version of the error-handler form Craig Boyd posted on his blog about four years ago. Craig also created some screencasts about error-handling. All of the links are at the end of this post.
  4. Name the app according to its purpose, not the tool it was written in
    Hey, I love Visual FoxPro as much as anyone, but I’m not naming my apps with the words “visual“, “fox“, “foxy” or “pro” in the name. I’ve seen enough “Visual Foxy Accounting Professional 2005” and “Foxy FeedReader Pro” apps to last me a lifetime.
  5. If you must display a MESSAGEBOX(), make sure to include a title
    Otherwise, the message comes from “Microsoft Visual FoxPro”, instead of from “The App You Paid Me Good Money To Write For You”.
  6. Include an ON SHUTDOWN command
    If you don’t, your users will likely see a lovely “Cannot quit Visual FoxPro” message when they try to exit the app. This is an easy fix for a common problem (as common as, “Why does my form flash, and then go away when my app starts?”).

Feel free to jump in via the Comments section. Do you agree that we should “Lose THE FoxPro”? Disagree? I’d love to hear your thoughts!

Craig Boyd – Professional Error Handling for VFP Applications
Craig Boyd – Learning VFP 104: Error Handling (A three-part video series)