"Exception has been thrown by the target of an invocation"
Instead of words, here is my code's logic :
while loop
run BGworker01
run BGworker02
...
run BGworker09
application.doEvents
thread.sleep(10)
end while
All the bgWorkers do the same thing (sending some data, only to different locations).
When i run this loop with only 1 Background-Worker, it's all fine,
but when i add the other bgWorkers i get the mentioned error at the "application.doEvents" part of the loop.
I think it also points to another place (highlighted in green) inside one of the bgworker's code :
Dim FileStreamToSend As FileStream = New FileStream(fileToSend, FileMode.Open)
I thought it might be a problem that all bgWorkers are trying to read from the same file together, but when i tried using different file for each bgWorker, the problem persisted.
I'm in early stages of learning vb.net (and .net in general),
So i would appreciate a simple explanation \ solution
Thank in advance !
Spelltox.
Instead of words, here is my code's logic :
while loop
run BGworker01
run BGworker02
...
run BGworker09
application.doEvents
thread.sleep(10)
end while
All the bgWorkers do the same thing (sending some data, only to different locations).
When i run this loop with only 1 Background-Worker, it's all fine,
but when i add the other bgWorkers i get the mentioned error at the "application.doEvents" part of the loop.
I think it also points to another place (highlighted in green) inside one of the bgworker's code :
Dim FileStreamToSend As FileStream = New FileStream(fileToSend, FileMode.Open)
I thought it might be a problem that all bgWorkers are trying to read from the same file together, but when i tried using different file for each bgWorker, the problem persisted.
I'm in early stages of learning vb.net (and .net in general),
So i would appreciate a simple explanation \ solution
Thank in advance !
Spelltox.