borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (challenging question...?)Next Topic (How to Cancel menu (in systray) when app is lost forcus) New Topic New Poll Post Reply
AndreaVB Forum : VB General : App Shutdown
Poster Message
cdwestby
Level: Guest


icon App Shutdown  Archived to Disk

Can anyone point me at a code snipet/routine that will allow me to automatically close/end a running vb app. I need to be able to notify all users that are currently running the app via a pop-up and then allow a couple of minutes for users to close at which time any stragglers get dumped.  (must be able to accomodate minimized window as well so as not to trash anyones work...)

Thanks...

18-04-2002 at 01:09 PM
| Quote Reply
JLRodgers
Level: Moderator

Registered: 04-04-2002
Posts: 1617
icon Re: App Shutdown  Archived to Disk

I'm assuming that you mean: you have a server vb app with client vb apps running, you wish to terminate the server vb app, with notifying the client users of the closure.

Based on that, I can think of two things offhand:
hardest:
1) Winsock control for direct server-pc connections (of course not all places will allow this, and you'd either need a table of all connected users [or text file],or  VB COM app also [which I normally don't do].
easiest
2) Put timers in the client apps, have a central db with a 2 tables, onethat only has one value ("closing", "not closing"), second with all current users (with a "close notified"). When you go to terminate the main vb app, change the "closing" table's value. Wait x minutes or until all values in the "connected" table say "notified".

If this would help, I can give more detailed info, but both are fairly extensive in length.

18-04-2002 at 02:50 PM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
cdwestby
Level: Guest

icon Re: App Shutdown  Archived to Disk

The second approach sounds like it will do what I need.  I'll give it a shot...

Thanks for your input.

19-04-2002 at 12:23 PM
| Quote Reply
JLRodgers
Level: Moderator

Registered: 04-04-2002
Posts: 1617
icon Re: App Shutdown  Archived to Disk

Something else that may be of use.

If there's a possibility that there won't be any clients open, have the server program check for any clients first; if none exist, then close immediately.

But if you just notify the clients, and not give them "input" as to the closing, then it might not even matter (although it could save a few minutes in wait time - depending on # of clients and other factors).

[Edited by admin on 14-05-2002 at 01:14 PM GMT]

19-04-2002 at 03:47 PM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
AndreaVB Forum : VB General : App Shutdown
Previous Topic (challenging question...?)Next Topic (How to Cancel menu (in systray) when app is lost forcus) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder