Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Launch a single form without desktop
Message
From
08/08/1999 10:11:38
 
 
To
08/08/1999 09:29:25
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00250896
Message ID:
00251236
Views:
16
>Hi Ed,
>
>Thanks for the help. The SCREEN = OFF in the config.fpw worked like a champ. I didn't however get the project to work without a main.prg with a DO FORM and READ EVENTS in it and a CLEAR EVENTS in the Destroy of the form. I am wondering how you can get the form to work as the main in the project. What I saw was the form came up for a moment then disappeared...
>

AFAIK, the only way to get this to work is with a modal form; control isn't passed back to the main VFP line of execution until the modal form is closed, so no READ EVENTS is needed. Try changing your form to a modal form (change the WindowType property of the Form to 1 rather than 0) and the problem will be fixed; if you need to launch other forms that operate in a modeless fashion, you'll need to pop off a READ EVENTS from somewhere controlled by the modal form, and you need to expect that control will be passed back to the line following the READ EVENTS at some point after the CLEAR EVENTS is issued.

I've found that it's much easier to build a minimal main program and handle forms with READ EVENTS except where all dialogs are modal; IOW, where control is never passed to a peer or parent form before the current form is closed. Menus and toolbars are a problem with modal forms (see the VFP docs on the WindowType property. there are differences in modal behavior with modal forms and modal formsets.)

IMO, it's easier and cleaner to do things using a programmatic main. You keep your options open that way - you can launch a modal or modeless form using the DO FORM approach, and you now have the option of using forms based on classes in .PRGs or VCXs rather than SCs, and this can yield big dividends at times (IOW, rather than DO FORM, you CREATEOBJ() or NEWOBJECT() an object based on the Form class or a subclass of a Form.)

>
>>Yes, you need a project; if the only thing that runs is a form, and that form can be modal, then simply make the form the main program in the project. if the form is not modal, or you need to load menus, etc and want an active READ EVENTS, then you need a short program to serve as your main that sets up the environment, launches your form, menus and whatever, and fires a READ EVENTS.
>>
>>You must have a project in order to compile to a .APP or .EXE file.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform