Results 1 to 2 of 2

Thread: help!!! program hangs

  1. #1

    Thread Starter
    Member
    Join Date
    May 2000
    Posts
    32
    I suppose program hangs because the thread doesn't terminates normally. please,take a look at the code
    below:

    option explicit
    Dim myThread As New clsThreads 'the class of thread

    Private Sub Form_Load()
    myThread.Initialize AddressOf Flicker
    myThraed.enable = true 'Flicker sub begins to work
    end sub

    Private Sub cmdStop_Click()
    Set myThread = Nothing
    End Sub

    ******** this is from clsThread class*********
    Private Sub Class_Terminate()
    Call TerminateThread(uThread.Handle, 0)
    lng = CloseHandle(uThread.Handle)
    End Sub
    ***********************************************

    so, after I click "cmdStop" button, process stays still
    active, but if I make:

    Private Sub Form_Load()
    myThread.Initialize AddressOf Flicker
    SET MYTHREAD = NOTHING
    end sub

    EVERYTHING IS OK!!!!! so, why if I set class thread
    to nothing in form_load sub, the thread terminates normally???

    thank You!



  2. #2
    Junior Member
    Join Date
    Aug 2000
    Location
    Rockford, IL
    Posts
    21

    Don't know..

    Can really tell...

    I don't know what you're code is suppose to really do...
    but perhaps its you're spelling

    You may have typed 'MyThread' wrong...(see below)

    myThread.Initialize AddressOf Flicker
    myThraed.enable = true 'Flicker sub begins to work

    I can take a look if you wanna send the source.

    [email protected]


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