Keeping a VB app running with multiple users

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

lamstaldy

Thread Starter
Joined
Dec 15, 2001
Messages
113
I have a VB app running on a computer at work. The VB app gathers data from a piece of automation, manipulates the data, and stores the data in Excel. The computer can be accessed by any one, and if some one logs off the computer my Vb app closes and I lose all the data until I get can start it up again in the morning. Is there any way to keep my app running when some one logs off?
 
Joined
Jul 29, 2001
Messages
21,334
Is it a standalone app on the users workstation or is it an app sitting on a server? It would seem like to do what you are attempting you would need a piece of software on each workstation to access the data on the LAN. Ever thought of a database and using the automation to update that? Everyone would then be able to access the data in a multi-user front end. Your current application needs to be modified so they are not actually exiting the application and terminating the whole process.
 

lamstaldy

Thread Starter
Joined
Dec 15, 2001
Messages
113
It is a stand alone application running on the computer. The data is coming in over the serial port from an Allen-Bradley PLC, so I don't have much control over where the data goes. I do have some 3rd party software that will take the data and send it anywhere on the network, but I'll have the same problem if some one logs off the computer the 3rd party software will close. I spent a few hours in MSDN looking for info on windows service apps, but I'm running VB6 with windows 98. From what I read it appears that I need XP or NT to utilize windows service apps.
 
Joined
Aug 17, 2001
Messages
7,486
From this MSDN page:

http://msdn.microsoft.com/library/d...y/en-us/wmeother/hh/wmeother/network_0515.asp

Windows 98/Me: Windows DDK

Logoff
When log off is occurring, all applications are shut down. They receive the same messages that they would receive when the system is shut down: WM_QUERYENDSESSION followed by WM_ENDSESSION. The lParam parameter has the EWX_REALLYLOGOFF bit set indicating that this is a log off, not a shutdown. The messages are sent through BroadcastSystemMessage, so they are received by all top-level windows, installable drivers, and VxDs.

Most ordinary applications are not affected by log on and log off, beyond the ordinary implications of active connections being disconnected and open files being closed. The primary purpose of this message is for network-specific applications which maintain internal state based on the current log on. For example, an application which receives messages from other stations might need to delete a NetBIOS name when the user logs off.

A service process that needs to stay running when the user logs off can call the RegisterServiceProcess API to make itself exempt from the automatic shutdown of all applications at logoff time.
Here's a link to a page explaining the API call:

http://www.allapi.net/apilist/RegisterServiceProcess.shtml
 

lamstaldy

Thread Starter
Joined
Dec 15, 2001
Messages
113
I want to thank you both for your help. Mosaic1 that link did the trick. To any one that is interested the link contains some sample code that will hide your app from the Ctrl-Alt-Del list. With a small change you can make so that the only way to close the app is to shut down the computer. There are 2 typos in the sample code, but Debug will point them out. Mosaic1 and Rockn, thanks again for the help.
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Top