How to protect a prog.-section to be opend twice ?

How to protect a prog.-section to be opend twice ?

Postby ukoenig » Sun Mar 20, 2016 12:21 pm

Hello,

I have to protect a program-section, to be opend twice in a lan.
For the moment I'm using a INI to detect if the section is in use.
Maybe still another solution ?
It belongs to the section < writing invoices > that can be open only once the same time.
In this section, some new DBF's must be created for calculations and statistics.
Or maybe a possible solution to show the metro-button DISABLED if in use ?

Image

best regards
Uwe :?:
Last edited by ukoenig on Sun Mar 20, 2016 12:32 pm, edited 1 time in total.
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: How to protect a prog.-section to be opend twice ?

Postby Marc Vanzegbroeck » Sun Mar 20, 2016 12:29 pm

Uwe,

Is this a seperate DBF-file in your program?
If so, maybe you can lock the DBF if you open this, and unlock if you leave it.
For the other users on the LAN you can chech if the file is locked in order To enable/disable this button.
Regards,
Marc

FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

Re: How to protect a prog.-section to be opend twice ?

Postby Antonio Linares » Sun Mar 20, 2016 12:32 pm

Uwe,

You could do a oBtn:Disable() or simple use a WHEN clause

but the Method Paint() of Class TMetroBtn has to be modified to paint it disabled
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42076
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: How to protect a prog.-section to be opend twice ?

Postby ukoenig » Sun Mar 20, 2016 12:36 pm

Antonio, Mark

thank You very much.
Maybe using a DUMMY.dbf on top of the section.
But I think a Button-disable might be a better solution.
The user can see, that it is impossible to write invoices for the moment.

best regards
Uwe :D
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 106 guests