Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Microsoft: FoxPro FAQ

Tips -N- Tricks

Why does my application jus flashes and closes when I start it. by Mike Gagnon
Posted: 28 Sep 03 (Edited 29 Sep 03)

When creating an application (executable), unless you are using a top-level form, you need to stop the application from closing, and have it wait for the user's input. I order to achieve this, you need to use a main program (a program that is "set to main", in the project manager). You actually only need two lines of code to start an application (other lines would be setting the paths for the data, setting the date style, setting global variables etc.).
  1. If you are using a menu with your application, you can use the following in your main program:
    DO myMenu.mpr
    READ EVENTS && The application will stop here and wait.

  2. If you are using a main form instead of a menu, the same principle applies.
    Do form myMainform.scx

  3. When it coes time to close the application, you needs to use CLEAR EVENTS, either in the QueryUnload of you main form, or in the exit of your menu.

This is a simplified version of a main program, but it will eliminate the problem of the application "just flashing" and closing on startup.

Mike Gagnon

Back to Microsoft: FoxPro FAQ Index
Back to Microsoft: FoxPro Forum

My Archive

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close