INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

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!

*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.

Jobs

Tips -N- Tricks

Why does my application jus flashes and closes when I start it. by mgagnon
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
    READ EVENTS

  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: Visual FoxPro FAQ Index
Back to Microsoft: Visual FoxPro Forum

My Archive

Resources

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