I discovered that the program would crash after several downloads. I assumed that the problem was the fact that each time a download was run, a new handle to the thread was created. So I ran the CreateThread command only on the first run, and directly called the thread on subsequent runs. That corrected the crashing issue, but then I discovered that the threads did not run concurrently after the first run. So then I ended the thread by using this command structure:
That fixed things in the IDE, but then I discovered that once compiled into an executable, an empty form would display when the thread was started, and that prevented me from testing the compiled version further.Code:Private Sub Command1_Click() If mHandle1 = 0 Then Call TerminateThread(mHandle1, ByVal 0&) mHandle1 = CreateThread(ByVal 0&, ByVal 0&, AddressOf Thread1, ByVal 0&, 0&, lpThreadId1) End Sub
I am at a loss as to how to proceed.
J.A. Coutts




Reply With Quote