Results 1 to 4 of 4

Thread: async call / non-blocking call to method of class

  1. #1

    Thread Starter
    Member
    Join Date
    Apr 2000
    Posts
    42
    hi.
    if i create a class in a diffrent thread..
    with "CreateObject"

    how can i call the method of this class ...
    in a async mode...
    ( non-block)
    this mean..calling to method and immediatly return and continute to excute code...
    while in the other thread the method is executed in the same time.

  2. #2
    Frenzied Member
    Join Date
    Mar 2000
    Posts
    1,089
    I think you need the function in the class to set a timer and then return, when the timer calls the function back d what the function needs to do and either call back the calling thread or raise an event.

  3. #3
    New Member
    Join Date
    Jan 2000
    Location
    Harare,(N/A), Zimbabwe
    Posts
    3

    Lightbulb

    Why don't you make your class as ActiveX exe. This way it
    will run in its own thread and won't block your application
    from running. Within this ActiveX exe you could include an
    event(s) which notify client application of success/failure/progress/completion of task.

    I wish you the best.

  4. #4
    Frenzied Member
    Join Date
    Mar 2000
    Posts
    1,089
    Sorry, I meant to say what Tom said aswell, the trouble is if you call a function from an activeX exe Vb waits until the function has finished until it resumes the thread, that's why you have to use the funny timer technique. It's quite hard to get the timing right though if what you're doing in the other thread is critical, a lot of the time the calling thread will finish everything it needs to do and just go on without the critical process in the other thread, causing all sorts of crazy side effects.

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