threading

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

Guest

hi i have a commandline that send data to 8 USB printer, but when one of the
printer is not working, the other 7 will also hanged. How can i use threading
to separate the 8 printing process?

For x = 0 To 7
If USBHandle(x) > 0 And USBAddressOn(x) = True Then

RetVal = WriteFile(USBHandle(x), ByteData(0), Len(Chunk),
ReturnBytes, OverLapped)

If ReturnBytes <> Len(Chunk) Then
PrintChunkUSB = -1
USBErrorFlag(x) = True
Exit Function
End If
End If
Next x
 
Just put the code in a method and then call it 8 times either asynchronously
or by spawning threads using System.Threading.Thread

HTH
rawCoder
 

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