Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Cetin Basoz
  Where is Cetin Basoz?
 Cetin Basoz
 To: Bob Lawson
  Where is Bob Lawson?
 Oakville, Ontario
 Bob Lawson
Subject: RE: Form as the desktop
Thread ID: 345499 Message ID: 345568 # Views: 61 # Ratings: 1
Version: Visual FoxPro 9 SP2 Category: Forms
Date: Thursday, May 24, 2012 1:56:54 PM         

> I am having a problem in an application that has a single form as the desktop.
> I have it setup so that when the application is run it displays the one form. When the person exits the form the application exists as well.
> When running in the IDE it displays the form and the IDE desktop disappears. The form runs fine and when I close the form the IDE is closed as well. All seems to work as I want.
> However when I package the application as an APP and run it on a target winXP it complains it can not find a file but the file path is wrong.
> I put in some messageboxes but none of them displays anything which gets me wondering.
> When you have a form as the desktop does the 'MAIN' program for the application still run?
> Are there any special considerations required for this configuration?
> Bob

It is really harder to control top level form based applications (I can say that because I am on version 12 Beta of an application that use top level forms since VFP5 and I still sometimes discover a new thing related to it:).

Unrelated to top level forms, the paths between the IDE version and exe might be different. In IDE version the path is stored in Tools\options\File locations\Search path. However this same path is not used in exe version, you need to explicitly have a set path command or have it in config.fpw file as:

path=data;bitmaps ...

As per the messageboxes, by default they show in main, and before the first form is shown there is nowhere that they would display. They are showing in main VFP screen (_screen) which is set to invisible in your case. The solution is to simply add 4096 to the second parameter so that it shows as system level messagebox and do not need a VFP screen/form be visible first. ie:

MessageBox( "Application path is:" + chr(13) + set('path'), 0 + 4096 )

Main (or whatever the file is set as main) would always run.

Any special considerations, hmmm might there be but you would ask that anyway when you hit:)
One that comes to mind is modal forms. Modal forms need to run in a 'parent' otherwise they are automatically turn out to be modeless. IOW for modal forms you would need ShowWindow=1. Sometimes you need them as modal and still yet to float freely as if they were top-level. Then the trick is set Desktop = .T.
Second that come to mind, don't try to use form's docking capabilities with toplevel forms. They simply don't work.

Cetin Basoz

.Net has got better.Think about moving - check my blog:
My Blog
Blog (mirror) - sounds to be down

Support Wikipedia


Form as the desktop Posted by Bob Lawson @ 5/23/2012 11:46:22 PM
RE: Form as the desktop Posted by Stefan Wuebbe @ 5/24/2012 7:16:21 AM
RE: Form as the desktop Posted by Cetin Basoz @ 5/24/2012 1:56:54 PM