Hi,
I have a really quick routine for finding next file to read, but I thought it would be great to have it running in the background and restart it when it's needed.
I tried to create the thread in the constructor and call it for the first time from there.
And when I need it again I tried
But I get an error telling me the thread is either running or stopped and can't be restarted
It's obviously not running, how should I restart it?!?
TIA
/Kejpa
I have a really quick routine for finding next file to read, but I thought it would be great to have it running in the background and restart it when it's needed.
I tried to create the thread in the constructor and call it for the first time from there.
Code:
_trdFindNextFile = New Threading.Thread(AddressOf FindNextFile)
_trdFindNextFile.Start()
Code:
_trdFindNextFile.Start()
Code:
Private Sub FindNextFile()
Trace.WriteLineIf(trcMainTrace.Info, "Looking for next log file", "cReadDemo.FindNextFile")
_NextFile = _File
_trdFindNextFile.Join(0)
End Sub
But I get an error telling me the thread is either running or stopped and can't be restarted
It's obviously not running, how should I restart it?!?
TIA
/Kejpa