Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How can I shutdown my app on all users??
Message
From
16/05/2002 12:39:11
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
 
 
To
16/05/2002 01:10:58
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00657264
Message ID:
00657580
Views:
27
>At any time, up to 6 users might be running my app (in .exe form) from the server, and have various tables open. Sometimes, I want to close all open forms, exit all users out of the system, close all tables, and lock them out so I can do some maintenance. I have to go to each PC and log them out, and tell them to stay out. How can I automate this while causing the least damage?
>
>Most users will only be viewing reports or other data, and only small chance they will actually be in the middle of an editing operation.
>
>Here is my initial effort... To kick them out, I added a timer to my base class form to look for a certain text file in a certain place on the server every 10 seconds. If it finds it, it calls a CLEAR EVENTS, which allows the main .prg to exit. So I made a .bat to create the "kick-them-out" file, and it works fairly well. Also, when the main program is executed, it checks for this lock-out file, and if it finds it, it will exit them out before any forms are loaded.

Exactly the solution I wanted to suggest when I read the first paragraph :)

>Only weird thing is, if someone is viewing a report, it doesn't exit properly.
>
>Any other ideas on how to do this?

Seems like the preview window has a mind of its own. You may try to run the preview in a window you can control - a blank form, for instance.
oPrevWind=createobject("form")
oPrevWind.windowstate=2   && this should be max, better check
* set other form properties if you like - set caption to report title etc
report form ... preview window (oPrevWind.name)
if type("oPrevWind.name")="C"  && check in case it got destroyed meanwhile
   oPrevWind.release
endif
IMO, the preview window would then be just another form, and if you destroy that along with any other form, it should just go away. Not sure this will work, but I think this wouldn't hurt to try.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform