Computer Science Canada

[Need Help] Checking For Multiple Instances..

Author:  the_short1 [ Fri May 21, 2004 10:12 pm ]
Post subject:  [Need Help] Checking For Multiple Instances..

hey is their a command or easy way to check for multiple instances of the same turing program??
\



i was thinking of a last resort:


at start of program
check if this file exists then EXIT
if file dont exist, then create it and run the program
at end of program delete that file.



proble is ... if u crash it... then u wont be able to run the program again until u delete the file manially... so is their a command for that>??? any better ideaS???

thanks

Author:  Tony [ Fri May 21, 2004 10:27 pm ]
Post subject: 

you could use VB (or C++) to check the system tray for running programs and search for the specific name. Unfortunatly turing doesn't support .dlls so the output would still have to come thought the external data file. But I suppose if you mark the file with system time, you could check for app crashes that way.

Author:  the_short1 [ Sat May 22, 2004 1:12 pm ]
Post subject: 

yea i was thinking on adding the time in case of crashes... but how would i use that to test for crashes..??? i have no clue

err... cant wait till summer... C++ here i come..

Author:  Tony [ Sat May 22, 2004 8:18 pm ]
Post subject: 

you would compare the time marker inside the file with the current system time. If the difference is too big, then you would know that the file was not updated in a while and it's information is too old to be considered valid. Otherwise you know that the information in the file is resent. You could then update it with new information and place a new time stamp for the next check

Author:  the_short1 [ Sat May 22, 2004 11:05 pm ]
Post subject: 

thanks tony... cuz i made taht emotions scresaver program into a .scr but when i ran in windows.. it would open it 50 times instead of one.... i got the if u move a mouse it closes deal..... and if u hit a key.... but that was plain NUTS.... it opened it 50 times....


: