Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Does an .exe access the contents of config.fpw

Status
Not open for further replies.

Loomis

Programmer
Jan 4, 2000
31
US
If ones application is compliled into an .exe file, how do you get it to access commands in a config.fpw file.

If a config file can't be used in conjuction with an .exe application, how do you issue a "screen=off" command so that the main visual foxpro screen won't flicker on startup? I am aware of the _screen.visible=.f. option, but this won't eliminate the flicker.
 
HI

Probably put it in the code.. in your main.prg..

IF !FILE("config.fpw")
=STRTOFILE("SCREEN=OFF","CONFIG.FPW")
ENDIF
DO FORM myMainForm
READ EVENTS

SO first time, application cannot use the config.fpw, but next time onwards, it will be in place.

:)

____________________________________________
ramani - (Subramanian.G) :)
When you ask VFP questions, please add VFP version.
Merry Christmas & Happy New Year
 
So, does an application compiled into an executable file (.exe) execute the commands in config.fpw just as it would if the app was running in Foxpro. If yes, how does it know where the config.fpw file is located?
 
Hi Loomis,

This is not a problem. In general, you can assume that your application will process the Config file. You don't need to write any special code to do it. If you have SCREEN=OFF in your Config, then SCREEN will be OFF when your application starts. The fact that the app is an EXE does not affect that.

how does it know where the config.fpw file is located?

First, it will look in the directory from which you launched the application. It will also look in the "start-up" directory specified in the Windows shortcut (if any), and all the directories on the DOS search path. You can also force it to look in a particular place by using the -c command line parameter.

Mike


Mike Lewis
Edinburgh, Scotland
 
Hi

You can also include the config.fpw file into your project in the Other -> Text Files section and then compile, that works for me...

Gerardo Czajkowski
ltc.jpg
 
The VFP help says that if a CONFIG.FPW file is included inside the .EXE as part of the project, then it will ALWAYS be loaded, and cannot be overridden with a command-line parameter or an external file.
 
Wgcs and Gerardo,

I suppose there might be times when you want to build the Config into the EXE, but it seems to be defeating the object. One of the advantages of having an independent Config file is that you can tweak the environment (search paths and the like) without having to rebuild the app.

Mike


Mike Lewis
Edinburgh, Scotland
 
That's true Mike, but not in my case at least.
Personally, I use config.fpw only to issue SCREEN = OFF and CODEPAGE = AUTO. For home directory and server location I set a couple of registry keys and the rest of the needed configuration is kept in an encripted table or inside the database for security purposes.

Gerardo Czajkowski
ltc.jpg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top