Local INI file

Local INI file

Postby codemaker » Sun Nov 03, 2013 4:21 pm

I have this situation:

The program and DBFs are installed on the SERVER
On each WS I have a mapped drive F which points to the servers drive where the program is installed
On the each WS desktop I have the shortcut which points to F\clock\program.exe, therefore on WS there is no Program.EXE and no related DBF at all.

Now I need the possibility to define the printers which each WS uses. This settings will be written in CLOCK.INI file but on WS MACHINE! So when the user runs the program and menu option to setup the printers for use, actually the LOCAL CLOCK.INI should be loaded and read. After the user confirms, the LOCAL INI file shoul be saved on WS machine somewhere.

This way whenever each WS user prints something the printout will go on the printer attached to each particular WS
One WS can have HP printer attached, other WS can have Samsung printer attached and so forth.

My problem is how to load and write the INI file which resides LOCAL machine, on each particular WS? I don't want to load the CLOCK.INI on SERVER, because then all WS would try to print on the printer which they do not have attached.

I know I saw somewhere the solution for this, bu am in big hurry and cannot remember where.
Thanks
User avatar
codemaker
 
Posts: 208
Joined: Wed Dec 03, 2008 4:48 pm
Location: Belgrade, Serbia

Re: Local INI file

Postby Enrico Maria Giordano » Sun Nov 03, 2013 6:02 pm

Boris,

you can put the INI file in a folder inside the WS temp directory.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8724
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Local INI file

Postby cnavarro » Sun Nov 03, 2013 6:06 pm

You can create a section in the CLOCK.INI with the name of each user and put your printer in this section
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6552
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Local INI file

Postby codemaker » Sun Nov 03, 2013 8:14 pm

Enrico,

When I run CLOCK.EXE on server, at the program beginning I have
SET DEFAULT TO csomePath
SET PATH TO cSomePAth

Whenever I USE some DBF it searches first in \cSomePath and that's ok

When I use low level functions, the files will be deleted or created in the folder where the CLOCK.EXE resides. If I want some specific file to handle I must put a prefix which denotes the folder:
If I use
INI oIni "CLOCK.INI"
it will use clock.ini in the folder where CLOCK.EXE is running, meaning - on server.

If I want some other INI file I do:
INI oIni (cSomePath + "\CLOCK.INI")

Now, how can I instruct the program to open each WS "CLOCK.INI" so each WS can use it own printers
As you said:
"you can put the INI file in a folder inside the WS temp directory."
How can I do that?

Thanks

@cnavarro
Yes, this is the idea I had but not the user, I need a WS name to store into the INI file section for each WS
On each WS severeal different users might log in
User avatar
codemaker
 
Posts: 208
Joined: Wed Dec 03, 2008 4:48 pm
Location: Belgrade, Serbia

Re: Local INI file

Postby Enrico Maria Giordano » Sun Nov 03, 2013 9:30 pm

Boris,

who is that runs CLOCK.EXE? I assumed that CLOCK.EXE is run by each WS, is it true? If yes, each WS can access its own INI file. If no, you have a problem. If CLOCK.EXE is run by the server, you had to share each WS drive so the server can access each WS INI file.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8724
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Local INI file

Postby cnavarro » Sun Nov 03, 2013 9:43 pm

Boris
And Section?
GetEnv( "COMPUTERNAME" ) + "_" + GetEnv( "USERNAME" )
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6552
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Local INI file

Postby codemaker » Sun Nov 03, 2013 10:01 pm

Enrico,

Yes, the CLOCK.EXE is on SERVER and each WS can run this program.

When I define the printers for from each WS the function
GetPvProfString( 'Printers', 'Regular', '', 'pay.ini' )
tries to read the printers from PAY.INI file in \WINDOWS folder

If the PAY.INI is not found (like the first time we run program from some WS) the program offers all installed printers on WS
We select one and write PAY.INI
And here I have a problem.
When I write PAY.INI this file is written on SERVER on folder \CLOCK where the CLOCK.EXE resides...
I want the PAY.INI to be written on some folder on the WS which called the program instead on SERVER
User avatar
codemaker
 
Posts: 208
Joined: Wed Dec 03, 2008 4:48 pm
Location: Belgrade, Serbia

Re: Local INI file

Postby codemaker » Sun Nov 03, 2013 10:04 pm

@cnavarro
yes, I can use this if I decide to have all user printers in that PAY.INI file on SERVER
Thanks
User avatar
codemaker
 
Posts: 208
Joined: Wed Dec 03, 2008 4:48 pm
Location: Belgrade, Serbia

Re: Local INI file

Postby Enrico Maria Giordano » Sun Nov 03, 2013 11:03 pm

Boris,

codemaker wrote:Enrico,

Yes, the CLOCK.EXE is on SERVER and each WS can run this program.

When I define the printers for from each WS the function
GetPvProfString( 'Printers', 'Regular', '', 'pay.ini' )
tries to read the printers from PAY.INI file in \WINDOWS folder

If the PAY.INI is not found (like the first time we run program from some WS) the program offers all installed printers on WS
We select one and write PAY.INI
And here I have a problem.
When I write PAY.INI this file is written on SERVER on folder \CLOCK where the CLOCK.EXE resides...
I want the PAY.INI to be written on some folder on the WS which called the program instead on SERVER


Just use the right path (ie. c:\myfolder\pay.ini).

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8724
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Local INI file

Postby codemaker » Mon Nov 04, 2013 12:46 am

Ok Enrico, thanks, will try it tomorrow.
User avatar
codemaker
 
Posts: 208
Joined: Wed Dec 03, 2008 4:48 pm
Location: Belgrade, Serbia


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 77 guests