Application.DoEvents()

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

i have 2 object function.
s.onSendprogress(byte_Sent , byte_Remaining)
s.SendData(Data)

how do i use application.doevents in such way that i have to make sure the
SendData function finish sending the data. I know i can check the
byte_Remaing values but i do not know whether the following is correct?

s.OnSendProgress(bytesent, byteremaining)
s.SendData(Chunk)
If byteremaining <> 0 Then
Do
Application.DoEvents()
Loop Until byteremaining = 0
End If

Does the above work? Do Application.DoEvents only affect s.SendData or both
functions?
 
Newbie,

In a normal situation there will be nothing to test.
A instruction is done instruction by instruction until it is ready.

Cor
 
The code is processed 1 line at a time. The SendData call will finish, and
the next line (the If line) will be executed. If SendData has not finished,
the If line is not executed.
 
Application.DoEvents() just hands back control to the operating system
momentarily, that's all.

Crouchie1998
BA (HONS) MCP MCSE
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top