D
davidst95
Hello,
I have a program that runs a long process. I tried to add a thread
to check if the use hit a cancel button to abort the process.
Dim t As Threading.Thread
t = New Threading.Thread(AddressOf StartProcess)
t.IsBackground = True
t.Priority = ThreadPriority.Highest
t.Start()
Do
Thread.CurrentThread.Sleep(500)
Application.DoEvents()
if bCancel=true then
t.Abort()
exit do
end if
Loop
When I add 'StartProcess' into a thread, it's about twice as slow if it
just ran it without a thread. Could anyone tell me what I'm not doing
right? Thanks. I played around with this all day and I'm lost.
Thanks.
David
I have a program that runs a long process. I tried to add a thread
to check if the use hit a cancel button to abort the process.
Dim t As Threading.Thread
t = New Threading.Thread(AddressOf StartProcess)
t.IsBackground = True
t.Priority = ThreadPriority.Highest
t.Start()
Do
Thread.CurrentThread.Sleep(500)
Application.DoEvents()
if bCancel=true then
t.Abort()
exit do
end if
Loop
When I add 'StartProcess' into a thread, it's about twice as slow if it
just ran it without a thread. Could anyone tell me what I'm not doing
right? Thanks. I played around with this all day and I'm lost.
Thanks.
David