Page 1 of 1

Our exe being locked

Posted: Tue Oct 20, 2020 2:07 pm
by omni
Roger.

we have some interface exe files we create to do requests and send files. Runs 24/7. User starts them. The issue is users do not pay attntion and will start them again. Eventually they lock up on one another.

Is there a method to block an exe (our exe) from being run more than one time. All are on windows servers.

(Like the new board view/format)


Fred
Omni

Re: Our exe being locked

Posted: Tue Oct 20, 2020 5:16 pm
by Auge_Ohr
hi,

have a look at DC_IsAppRunning() in x:\exp20\Source\Dclipx\_dcfunct.prg

Re: Our exe being locked

Posted: Tue Oct 20, 2020 5:33 pm
by bwolfsohn
This handles multiple applications that can run from the same exe

if is_running({"Password","CUS Auction Management System","Monitor Online Auction(s)","Real-Time Sale Viewing"})
RETURN .f.
endif


*******************
function is_running(aApp)
*******************
local cApp,i
IF SET_MULTIRUN
return(.f.)
ENDIF
IF fexists('multirun.ovl')
return(.f.)
ENDIF
IF valtype(aApp)<>"A"
cApp:=aApp
aApp:={}
aadd(aApp,cApp)
ENDIF
FOR i := 1 TO len(aApp)
IF DC_IsAppRunning('XbpDialog',aApp,,.t.) .OR. DC_IsAppRunning('XbpPmtClass',aApp,,.t.)
IF yes_no3("This application is already running on this machine. Continue ?")
RETURN .f.
else
RETURN .t.
ENDIF
endif
NEXT
return(.f.)