When I followed the instructions, all the program did was pop up and
disappear without waiting for a user input.
Let me know if you get this to work yourself.
--
Dean 'DacMan' Penderghast
CITAP Accounting Software Services, Inc.
a division of PFG, Inc.
215 E. Orangethorpe Ave, #285 * Fullerton, CA 92832
Office: (714) 777-7909 * Fax: (714) 777-7908
Web: http://www.flash.net/~citap
EMail: sa...@citapinc.com
** We put YOU in control! **
И,јЄКА`АКЄј,ИИ,јЄКА`АКЄј,ИИ,јЄКА`АКЄј,ИИ,јЄКА`АКЄј,ИИ,јЄКА`АКЄј,ИИ,јЄКА`
"Richard" <richar...@21cn.com> wrote in message
news:uBct9v2n$GA.1672@cppssbbsa06...
> When you execute an EXE vfp application, there's always a VFP main
> window, even you set your form's desktop property to .T., how to build an
> EXE file without the main window? Because my program is very simple and I
> needn't the main window.
>
> Thanks
>
> Richard
>
>
>
>
with _screen
.visible =.F.
endwith
N.B. if you run your exe from command window set the visible property to .T.
in you quit (shutdown) routine. For more info. see _screen in help file.
Richard wrote in message ...
Dean Penderghast <sup...@citapinc.com> schrieb in im Newsbeitrag:
Ou0ZLp4n$GA.1476@cppssbbsa06...
: Been strugling with that myself. I was told to look at the VFP Help
system
: under Using VFP->Programmer's Guide->Creating the Interface->Creating
Forms.
: Look for the topic "To hide the main Visual FoxPro window " and follow the
: screens. or try clicking on this :
:
mk:@MSITStore:c:\program%20files\microsoft%20visual%20studio\msdn98\98vsa\10
: 33\foxhelp.chm::/html/lnginsert___sql.htm
:
: When I followed the instructions, all the program did was pop up and
: disappear without waiting for a user input.
I bet you didn't put the form.ShowWindow property to 2 (As TopLevel-Form)
<g>
HTH
Markus
Oh yes I did. Here are the settings that I changed:
Desktop = .T.
ShowWindow = 2 - As Top Level
Movable = .t.
TitleBar = .t.
WindowType = Modeless
The PRG is the main file. It stores all of the functions and procedures
that I use in both FPW26 and VFP. The first line of the PRG is simply DO
FORM FORM1
Any other ideas Markus?
--
Dean 'DacMan' Penderghast
CITAP Accounting Software Services, Inc.
a division of PFG, Inc.
215 E. Orangethorpe Ave, #285 * Fullerton, CA 92832
Office: (714) 777-7909 * Fax: (714) 777-7908
Web: http://www.flash.net/~citap
EMail: sa...@citapinc.com
** We put YOU in control! **
И,јЄКА`АКЄј,ИИ,јЄКА`АКЄј,ИИ,јЄКА`АКЄј,ИИ,јЄКА`АКЄј,ИИ,јЄКА`АКЄј,ИИ,јЄКА`
"Markus Voellmy" <mvoe...@swissonline.ch> wrote in message
news:e0USlx6n$GA.1492@cppssbbsa06...
I have indeed. Do you have also put a READ EVENTS in your Code? I should
have asked this already in the last message because it's one of the most
popular faults that happens. When you leave the DE by building an .EXE you
have to tell VFP to install your own event handling. Normaly you have a
procedure "MAIN" from where you start your EXE by setting it's
environnement, global vars (eek) and so on. There, just after you launched
your form or your menu put a READ EVENTS in. But don't forget to put also
somewhere a coresponding CLEAR EVENTS in the shutdown code off the form or
the menu or you'll probably end resetting your computer or at least have to
kill the Exe with the task manager <g>
After the CLEAR EVENTS is called the code processing jumps back to the
MAIN-procedure just after the READ EVENTS-Statement.
Have a nice day
Markus
Dean Penderghast <sup...@citapinc.com> schrieb in im Newsbeitrag:
#Ze#y28n$GA.1680@cppssbbsa06...
If that's the case, I wish the online manual was clearer about that.
--
Dean 'DacMan' Penderghast
CITAP Accounting Software Services, Inc.
a division of PFG, Inc.
215 E. Orangethorpe Ave, #285 * Fullerton, CA 92832
Office: (714) 777-7909 * Fax: (714) 777-7908
Web: http://www.flash.net/~citap
EMail: sa...@citapinc.com
** We put YOU in control! **
И,јЄКА`АКЄј,ИИ,јЄКА`АКЄј,ИИ,јЄКА`АКЄј,ИИ,јЄКА`АКЄј,ИИ,јЄКА`АКЄј,ИИ,јЄКА`
"Markus Voellmy" <webm...@33ertaxi.ch> wrote in message
news:u0uGVj9n$GA.1000@cppssbbsa06...
*Main.PRG
*
DO FORM myform
READ EVENTS
You can then have the CLEAR EVENTS in the form's Destroy method, if you only
have this one form in your application.
Fred
Dean Penderghast wrote in message ...
Man, you are the KING!!! This is great stuff to learn.
OK, I do have one item that might make the code a tad smaller. You have
this section:
gcRootdir = lower(strtran(justpath(sys(16)),'PROGRAMS'))
This can also be done using the following command:
gcRootDir = lower(set('default') + sys(2003)) + '\'
Also, do you mind emailing me directly that base-line project you have? I'd
really apreciate it.
Thanks.
--
Dean 'DacMan' Penderghast
CITAP Accounting Software Services, Inc.
a division of PFG, Inc.
215 E. Orangethorpe Ave, #285 * Fullerton, CA 92832
Office: (714) 777-7909 * Fax: (714) 777-7908
Web: http://www.flash.net/~citap
EMail: sa...@citapinc.com
** We put YOU in control! **
И,јЄКА`АКЄј,ИИ,јЄКА`АКЄј,ИИ,јЄКА`АКЄј,ИИ,јЄКА`АКЄј,ИИ,јЄКА`АКЄј,ИИ,јЄКА`
"Jason King" <jase...@ihug.co.nz> wrote in message
news:8cj31k$21h$1...@news.ihug.co.nz...
>
>
> Here is some code that I reuse time and time again. Most is shamelessly
> lifted from other people
> (including the application built by the app wizard).
>
> Plagiarise,plagiarise,plagiarise.
> Tom Lehreh
>
> See him betray his UK citizenship by confident omission of 'Z's
.......
>
> Hope this helps.
> Jason King
> dbPlatypus Ltd
>
> jase...@ihug.co.nz
>
>
> Richard <richar...@21cn.com> wrote in message
> news:uBct9v2n$GA.1672@cppssbbsa06...
Jason King <jase...@ihug.co.nz> wrote in message
news:8cj31k$21h$1...@news.ihug.co.nz...
> *!* set up 'pointers' to the bits and bobs I neeed
> set procedure to gcProgs + 'miscFuncs.prg' additive
> set classlib to gcClasses + 'db.vcx' additive
> set classlib to gcClasses + 'splash.vcx' additive
> set classlib to gcClasses + 'app.vcx' additive
> set classlib to gcClasses + 'screens.vcx' additive
> set classlib to gcClasses + 'objects.vcx' additive
> set classlib to gcClasses + '_ui.vcx' additive
FYI, you can put all of this in a single line:
SET CLASSLIB TO db.vcx, splash.vcx, app.vcx, etc
You can do the same with multiple Procedure files.
Best regards,
Tom
You metioned that you declair with only five variables. Would you like to
share your version of the 'generic startup' code with the rest of us?
--
Dean 'DacMan' Penderghast
CITAP Accounting Software Services, Inc.
a division of PFG, Inc.
215 E. Orangethorpe Ave, #285 * Fullerton, CA 92832
Office: (714) 777-7909 * Fax: (714) 777-7908
Web: http://www.flash.net/~citap
EMail: sa...@citapinc.com
** We put YOU in control! **
И,јЄКА`АКЄј,ИИ,јЄКА`АКЄј,ИИ,јЄКА`АКЄј,ИИ,јЄКА`АКЄј,ИИ,јЄКА`АКЄј,ИИ,јЄКА`
"Markus Voellmy" <webm...@33ertaxi.ch> wrote in message
news:eFBS#QDo$GA.187@cppssbbsa04...
> Hi Jason
>
> Jason King <jase...@ihug.co.nz> schrieb in im Newsbeitrag:
> 8cj31k$21h$1...@news.ihug.co.nz...
> >
> >
> > Here is some code that I reuse time and time again. Most is shamelessly
> > lifted from other people
> > (including the application built by the app wizard).
> >
> > Plagiarise,plagiarise,plagiarise.
> > Tom Lehreh
> >
> [snip]
>
> > See him betray his UK citizenship by confident omission of 'Z's
> > I would welcome any feedback with this code - I am a tough critic on
> myself,
> > and love to improve my own coding
> > techniques and standards. Please criticise freely, but refrain from
> > comments regarding authors.height (groan).
> >
>
> I am a "hardliner", so (as you mentioned absolutely correct <bg> ) my
> version of this piece
> of code is built into several classes as for application, environment,
> splashscreen etc.
> And it's mostly even the same way "collected" as a here and there fetched
> result of the
> blood, sweat and tears of many other guy.
>
> But doing some sort of x-base coding since the glorious days of dBase II
> (must have been
> one of Ashton-Tates first customers <g>) showed to me, that you won't find
> many programmers
> doing the same things exactly the same way. That get's really obvious to
> you, when you have to
> maintain another ones code (OK, I admit, this ocasionally happens to me
as
> well with my own
> code, I wrote sometimes ago <g> ).
>
> So, looking at your code the only thing I would really consider worth to
> change is the declaration
> of Public vars. You get to easy in bad trouble with them. Furthermore you
> don't need the Public-
> keyword here at all. Because you are allready in the uppermost level of
your
> prog, even the var's
> you explicitely declare as local in "main" are in scope downstairs the
> calling chain just waiting to be
> somewhere luckily "redefined" or "reassigned" by a typo or an omitted
local
> statement in a
> procedure or a function.
>
> I need exactly 5 "globals" to bring some crucial "Settings" into my
> environment object and release
> them as soon as the object is instanciated correctly. That feature of
hiding
> mostly everything in well
> hidden and even protected propertys, was one of the reason why I nearly
with
> "light-speed" got an
> OOP-Freak the moment I realized how many hours of my live I could have
spent
> with much more
> pleasant things than debugging "side-effects". <bg>
>
> So have a nice time "downunder" and good hacking.
>
> Markus
>
>
>
SCREEN=OFF
Include config.fpw in your exe build or place it in the same
directory as your exe.
Roger
Here is some code that I reuse time and time again. Most is shamelessly
lifted from other people
(including the application built by the app wizard).
Plagiarise,plagiarise,plagiarise.
Tom Lehreh
See him betray his UK citizenship by confident omission of 'Z's
*!* Firstly, if you are in the VFP dev environment (ie not a stand alone
exe)
*!* and wish to have debug etc, leave the screen on:
*!* _screen.visible = .f.
*!* Declare some public vars (ooh errr) for useful paths - these are
important to me as they
*!* allow me to have a logical project structure and avoids errors of being
in an unexpected
*!* directory (too cautious? - I think not). For the hardliners, these
could be properties of
*!* an application object
public gcRootDir, gcReadOnlyData, gcWorkData, gcTempData, gcProgs,
gcScreens, gcMenus,gcClasses
gcReadOnlyData = ""
*!* now we get the root directory of the project by using sys(16) to return
the path of the currently
*!* running program (ie this code) - if this is compiled into an exe, I WILL
have placed it into the
*!* correct folder (ie the project folder), if this is not an exe but is
running in the dev environment,
*!* sys(16) will return the path to this program which is
myprojectFolder\programs\myprog.prg.
*!* I therefore have to strtran out PROGRAMS to get the correct root
directory path. Try it with debugger to see
gcRootdir = lower(strtran(justpath(sys(16)),'PROGRAMS')) && get the current
drive and directory of compiled exe
*!* set up the rest paths to my folders -
gcWorkData = gcRootdir + 'workData\'
gcTempData = gcRootdir + 'tempData\'
gcProgs = gcRootDir + 'programs\'
gcScreens = gcRootDir + 'screens\'
gcmenus = gcRootDir + 'menus\'
gcClasses = gcRootDir + 'classes\'
*!* set up 'pointers' to the bits and bobs I neeed
set procedure to gcProgs + 'miscFuncs.prg' additive
set classlib to gcClasses + 'db.vcx' additive
set classlib to gcClasses + 'splash.vcx' additive
set classlib to gcClasses + 'app.vcx' additive
set classlib to gcClasses + 'screens.vcx' additive
set classlib to gcClasses + 'objects.vcx' additive
set classlib to gcClasses + '_ui.vcx' additive
*!* clean up any old tables left hanging around from failed debugging etc
close databases all
*!* Launch a splash screen - if you are hiding the dev environment, this
should be set to As Top Level (if you are hiding
*!* the _screen and the form is In Screen, of course, you won't see it).
Make sure that the form is not modal.
local lnSplashDelay, loSplash, lnSeconds
lnSeconds = SECONDS()
lnSplashdelay = 3
do form (gcScreens + 'mySplash') name loSplash
*!* Do any other preapplication processing here (such as set talk, declare
publics etc etc)
*!* Launch your main form (which drives all the others) or your application
object. Make sure it is Top Level
do form (gcScreens + 'startForm') && THIS IS THE MONEY SHOT RIGHT HERE
IF VARTYPE(loSplash) = "O"
*!* Keep the splash screen open for the delay that has been set
*!* "MH" means wait for mouse, hide flashing cursor
IF SECONDS() < lnSeconds + lnSplashDelay
=INKEY(lnSplashDelay-(SECONDS()-lnSeconds),"MH")
ENDIF
loSplash.Release()
loSplash = .NULL.
ENDIF
RELEASE loSplash, lnSeconds, lnSplashDelay
read events && start to handle the events (ie interaction with forms)
*!* - the following code is not run until VFP gets a CLEAR EVENTS from the
death throws of the main form,
*!* toolbar or object etc
*!* clean up and restore the environment such as VFP menus etc
*!* turn the screen back on (doesn't matter if it is already on - no harm
done)
_screen.visible = .t.
clear menus
close data all
release all
If your app has problems finishing, maybe you have a dangling reference
somewhere - an object that is still existing
even though the variable it was bound to has been killed. You can use
'disp memo' to squirt out variables from the command line.
As you can see above with splash screen, we have bound the
screen to a variable called loSplash. We then called the form's release
method (loSplash.release) to kill the form
then we reassigned the same variable to a null value just to make sure, and
finally released the variable. That suckers
gone!
Now you ask yourself, how come the splash screen doesn't disappear straight
away like my main form used to?
The answer is this - the splash is launched, and code execution CONTINUES
back in this program, until eventually
we reach a read events which means 'hey, wait for the user now - no more
code without user interaction'.
If we did not have this read events, the start form would launch, the splash
would eventually time out and then we go straight
to the clean up (if it exists) which kills everything, or we reach the end
of program, which is essentially 'finish here'.
This is what happens with your old main screen - it simply runs out of code
and dies.
Don't forget to include SCREEN=OFF in the config.fpw file with your exe (or
included in it).
I would welcome any feedback with this code - I am a tough critic on myself,
and love to improve my own coding
techniques and standards. Please criticise freely, but refrain from
comments regarding authors.height (groan).
Any questions, you know what to do - mail me.
Hope this helps.
Jason King
dbPlatypus Ltd
Jason King <jase...@ihug.co.nz> schrieb in im Newsbeitrag:
8cj31k$21h$1...@news.ihug.co.nz...
>
>
> Here is some code that I reuse time and time again. Most is shamelessly
> lifted from other people
> (including the application built by the app wizard).
>
> Plagiarise,plagiarise,plagiarise.
> Tom Lehreh
>
[snip]
> See him betray his UK citizenship by confident omission of 'Z's
> I would welcome any feedback with this code - I am a tough critic on
myself,
> and love to improve my own coding
> techniques and standards. Please criticise freely, but refrain from
> comments regarding authors.height (groan).
>
I am a "hardliner", so (as you mentioned absolutely correct <bg> ) my
To build an EXE application without the main VFP window, what need to do is
put config.fpw with "screen=off" with your exe program and set form property
showwindow to 2.
a simple example is:
main.prg
...
do Myform
read events
...
return
property of Myform
showwindow - 2
config.fpw
screen=off
then it works.
thank again for those advice!
Richard
Dean Penderghast <sup...@citapinc.com> wrote in message
news:Ou0ZLp4n$GA.1476@cppssbbsa06...
> Been strugling with that myself. I was told to look at the VFP Help
system
> under Using VFP->Programmer's Guide->Creating the Interface->Creating
Forms.
> Look for the topic "To hide the main Visual FoxPro window " and follow the
> screens. or try clicking on this :
>
mk:@MSITStore:c:\program%20files\microsoft%20visual%20studio\msdn98\98vsa\10
> 33\foxhelp.chm::/html/lnginsert___sql.htm
>
> When I followed the instructions, all the program did was pop up and
> disappear without waiting for a user input.
>
> Let me know if you get this to work yourself.
>
> --
> Dean 'DacMan' Penderghast
> CITAP Accounting Software Services, Inc.
> a division of PFG, Inc.
> 215 E. Orangethorpe Ave, #285 * Fullerton, CA 92832
> Office: (714) 777-7909 * Fax: (714) 777-7908
> Web: http://www.flash.net/~citap
> EMail: sa...@citapinc.com
> ** We put YOU in control! **
> ?齯滌`偕爻,虜,齯滌`偕爻,虜,齯滌`偕爻,虜,齯滌`偕爻,虜,齯滌`偕爻,虜,齯滌`
Of particular interest to me was:
sticking all library declarations into one line - nice
unnecessary scoping of global vars as 'downstairs' (nice!) programs can
already see them.
KUPGW*
jase...@ihug.co.nz
*keep up the good work
Jason King <jase...@ihug.co.nz> wrote in message
news:8cj31k$21h$1...@news.ihug.co.nz...
>
>
Create a Form.
Set the ShowWindow property to "2 - As Top-Level Form"
Set the AutoCenter property to ".T. - True"
Add this code to the Unload event:
Clear Events
Create a text file named "Config.fpw" with this text:
screen=off
Create a project and add these files with the text file in the "Other"
Section. Set the "Main" program to main.
Compile and run.... No FoxPro Window... just like VB :)
Actually, the step of creating the config.fpw isn't necessary. I just put
the following line in the beginning of my code:
_screen.visible = .f.
Then at the end, I put the following code:
_screen.visible = .t.
It works like a champ!
--
Dean 'DacMan' Penderghast
CITAP Accounting Software Services, Inc.
a division of PFG, Inc.
215 E. Orangethorpe Ave, #285 * Fullerton, CA 92832
Office: (714) 777-7909 * Fax: (714) 777-7908
Web: http://www.flash.net/~citap
EMail: sa...@citapinc.com
** We put YOU in control! **
И,јЄКА`АКЄј,ИИ,јЄКА`АКЄј,ИИ,јЄКА`АКЄј,ИИ,јЄКА`АКЄј,ИИ,јЄКА`АКЄј,ИИ,јЄКА`
"P Swanson" <paul.s...@ingrammicro.com> wrote in message
news:eAPEZiKo$GA.250@cppssbbsa05...
Dean Penderghast <sup...@citapinc.com> wrote in message
news:uFiL1LLo$GA.256@cppssbbsa03...
> Paul:
>
> Actually, the step of creating the config.fpw isn't necessary. I just put
> the following line in the beginning of my code:
>
> _screen.visible = .f.
>
> Then at the end, I put the following code:
>
> _screen.visible = .t.
>
> It works like a champ!
>
> --
> Dean 'DacMan' Penderghast
> CITAP Accounting Software Services, Inc.
> a division of PFG, Inc.
> 215 E. Orangethorpe Ave, #285 * Fullerton, CA 92832
> Office: (714) 777-7909 * Fax: (714) 777-7908
> Web: http://www.flash.net/~citap
> EMail: sa...@citapinc.com
> ** We put YOU in control! **
> ?齯滌`偕爻,虜,齯滌`偕爻,虜,齯滌`偕爻,虜,齯滌`偕爻,虜,齯滌`偕爻,虜,齯滌`