Results 1 to 14 of 14

Thread: VB6-MultiThread Download

Threaded View

  1. #8

    Thread Starter
    Frenzied Member
    Join Date
    Dec 2012
    Posts
    1,674

    Re: VB6-MultiThread Download

    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:
    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
    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.

    I am at a loss as to how to proceed.

    J.A. Coutts
    Last edited by couttsj; Sep 17th, 2023 at 08:31 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width