Click here to Skip to main content
15,923,910 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralSQL Select statment Pin
iluha5-May-03 12:41
iluha5-May-03 12:41 
GeneralRe: SQL Select statment Pin
ScaleOvenStove5-May-03 13:18
ScaleOvenStove5-May-03 13:18 
GeneralRe: SQL Select statment Pin
iluha5-May-03 14:18
iluha5-May-03 14:18 
GeneralRe: SQL Select statment Pin
Nick Parker10-May-03 11:44
protectorNick Parker10-May-03 11:44 
QuestionServices - prevent from being stopped? Pin
Mike Mestemaker5-May-03 7:54
Mike Mestemaker5-May-03 7:54 
AnswerRe: Services - prevent from being stopped? Pin
Ray Cassick5-May-03 8:14
Ray Cassick5-May-03 8:14 
AnswerRe: Services - prevent from being stopped? Pin
Heath Stewart5-May-03 8:26
protectorHeath Stewart5-May-03 8:26 
GeneralRe: Services - prevent from being stopped? Pin
Mike Mestemaker5-May-03 11:48
Mike Mestemaker5-May-03 11:48 
Thanks for the advice. Let me see if I understand the basic concept:

At the beginning of the processing section that I want to be "uninterruptible":

Try<br />
   Dim M As New Threading.Mutex(True, "myUniqueCode")<br />
   ' do the processing<br />
Finally<br />
   M.Close()<br />
End Try


In the OnStop event

Dim M As New Threading.Mutex(True, "myUniqueCode")<br />
Do Until M.WaitOne(1000, False)<br />
Loop<br />
M.Close()<br />
'do any resource cleanup here


Related question: What is the correct way to shut down my service from within it's own code? For example, if my service encounters a condition that tells it to end (other than the SCM's stop command), how does it shut itself down cleanly? I read somewhere that the END command is considered bad form for services.

Long term, my application will consist of multiple services (each with their own uninterruptable sections). Some will be more sensitive to this issue than others. I'm thinking of creating an applet that will send a message to each of them and they will shut themselves down when they are free from whatever they were doing). The applet can show the status of each one in turn so the user can watch them shutting down and know when it is safe to proceed.
GeneralRe: Services - prevent from being stopped? Pin
Heath Stewart6-May-03 1:23
protectorHeath Stewart6-May-03 1:23 
AnswerRe: Services - prevent from being stopped? Pin
ekareem5-May-03 18:57
ekareem5-May-03 18:57 
GeneralWeb Browser Control in VB.Net Pin
ScaleOvenStove4-May-03 7:13
ScaleOvenStove4-May-03 7:13 
GeneralPrint Listview control to printer Pin
pradipta3-May-03 1:57
pradipta3-May-03 1:57 
GeneralReplacement for "line"-contol. Pin
Ralf Friedrich Hain2-May-03 22:01
Ralf Friedrich Hain2-May-03 22:01 
GeneralWindows Comman Taks in VB.NET Pin
Villly2-May-03 20:48
Villly2-May-03 20:48 
GeneralRe: Windows Comman Taks in VB.NET Pin
J. Dunlap2-May-03 20:53
J. Dunlap2-May-03 20:53 
GeneralRe: Windows Comman Taks in VB.NET Pin
Villly2-May-03 21:01
Villly2-May-03 21:01 
GeneralRe: Windows Comman Taks in VB.NET Pin
Villly6-May-03 1:54
Villly6-May-03 1:54 
GeneralRe: Windows Comman Taks in VB.NET Pin
J. Dunlap6-May-03 10:43
J. Dunlap6-May-03 10:43 
GeneralRe: Windows Comman Taks in VB.NET Pin
Villly6-May-03 20:14
Villly6-May-03 20:14 
GeneralRe: Windows Comman Taks in VB.NET Pin
Villly9-May-03 21:39
Villly9-May-03 21:39 
GeneralRe: Windows Comman Taks in VB.NET Pin
J. Dunlap9-May-03 21:55
J. Dunlap9-May-03 21:55 
GeneralRe: Windows Comman Taks in VB.NET Pin
Villly9-May-03 22:36
Villly9-May-03 22:36 
GeneralRe: Windows Comman Taks in VB.NET Pin
J. Dunlap12-May-03 8:09
J. Dunlap12-May-03 8:09 
GeneralLimitations of VB Pin
atif_2-May-03 9:24
atif_2-May-03 9:24 
GeneralRe: Limitations of VB Pin
Nick Seng2-May-03 15:34
Nick Seng2-May-03 15:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.