Click here to Skip to main content
15,887,214 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Help... Again... Pin
Member 1072866720-Apr-14 8:13
Member 1072866720-Apr-14 8:13 
GeneralRe: Help... Again... Pin
Wes Aday20-Apr-14 8:36
professionalWes Aday20-Apr-14 8:36 
GeneralRe: Help... Again... Pin
Tino Fourie24-Apr-14 7:00
Tino Fourie24-Apr-14 7:00 
QuestionAbout handling MSComm events in VB6 Pin
Member 1056890820-Apr-14 5:20
Member 1056890820-Apr-14 5:20 
AnswerRe: About handling MSComm events in VB6 Pin
Eddy Vluggen21-Apr-14 8:18
professionalEddy Vluggen21-Apr-14 8:18 
GeneralRe: About handling MSComm events in VB6 Pin
Member 1056890821-Apr-14 14:27
Member 1056890821-Apr-14 14:27 
GeneralRe: About handling MSComm events in VB6 Pin
Eddy Vluggen21-Apr-14 22:33
professionalEddy Vluggen21-Apr-14 22:33 
GeneralRe: About handling MSComm events in VB6 Pin
Nicholas Marty22-Apr-14 0:06
professionalNicholas Marty22-Apr-14 0:06 
I guess the events are going to be queued. At least a lot of events work like that. That means: As soon as you finish the work in your events (or you make a call to DoEvents and please... don't do that if you can avoid it...) the next event which should have been triggered while you were processing something should get processed.

At least that's how the Windows Message queue should work. But you have to test it to be sure it really works that way.


Example: A VB6 application with 2 Command Buttons.

VB
Private Declare Sub Sleep Lib "kernel32.dll" (ByVal dwMilliseconds As Long)
Private Sub Command1_Click()
   Debug.Print "Begin Command1"
   Sleep 5000
   'DoEvents 'Comment out to see what DoEvents does
   Debug.Print "End Command1"
End Sub

Private Sub Command2_Click()
   Debug.Print "Command2"
End Sub


If you execute the program and click on Command1 first and then on Command2 you should see that the "End Command1" messages executes before (or after in case of a call to DoEvents) the message "Command2". And that the Event of Command2_Click has been queued while the application was busy processing Command1. You can even Click on Command2 e.g. 3 times and the event will be executed 3 times after the Sleep from Command1 is finished.

But there are cases where this does not apply. An example is the Timer (at least the control you can drag on the form).

Important is that the events are sent through the "Windows message queue".
GeneralRe: About handling MSComm events in VB6 Pin
Member 105689083-May-14 21:41
Member 105689083-May-14 21:41 
QuestionRounding To 2 Decimal Places Pin
Member 1072866719-Apr-14 16:46
Member 1072866719-Apr-14 16:46 
AnswerRe: Rounding To 2 Decimal Places Pin
Richard MacCutchan19-Apr-14 21:22
mveRichard MacCutchan19-Apr-14 21:22 
QuestionQueue and Stack Pin
DJHJr17-Apr-14 8:04
DJHJr17-Apr-14 8:04 
AnswerRe: Queue and Stack Pin
Eddy Vluggen17-Apr-14 8:31
professionalEddy Vluggen17-Apr-14 8:31 
GeneralRe: Queue and Stack Pin
DJHJr17-Apr-14 9:07
DJHJr17-Apr-14 9:07 
GeneralRe: Queue and Stack Pin
Eddy Vluggen17-Apr-14 10:24
professionalEddy Vluggen17-Apr-14 10:24 
Questionfilesystemwatcher possible infinite loop Pin
Tony Snowden17-Apr-14 0:20
Tony Snowden17-Apr-14 0:20 
AnswerRe: filesystemwatcher possible infinite loop Pin
Richard Andrew x6417-Apr-14 0:45
professionalRichard Andrew x6417-Apr-14 0:45 
GeneralRe: filesystemwatcher possible infinite loop Pin
Tony Snowden17-Apr-14 1:07
Tony Snowden17-Apr-14 1:07 
QuestionHow to Run Transparent Flash Files Over a Running Video in VB Pin
NAVEEN SONI16-Apr-14 17:56
NAVEEN SONI16-Apr-14 17:56 
QuestionPass a string to a control on a form from a remoting connection Pin
ParadoxLiving15-Apr-14 20:27
ParadoxLiving15-Apr-14 20:27 
AnswerRe: Pass a string to a control on a form from a remoting connection Pin
Alan N16-Apr-14 4:48
Alan N16-Apr-14 4:48 
GeneralRe: Pass a string to a control on a form from a remoting connection Pin
ParadoxLiving16-Apr-14 16:07
ParadoxLiving16-Apr-14 16:07 
QuestionStart another process as admin Pin
Dominick Marciano15-Apr-14 3:52
professionalDominick Marciano15-Apr-14 3:52 
AnswerRe: Start another process as admin Pin
Bernhard Hiller15-Apr-14 22:25
Bernhard Hiller15-Apr-14 22:25 
GeneralRe: Start another process as admin Pin
Dominick Marciano16-Apr-14 8:22
professionalDominick Marciano16-Apr-14 8:22 

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.