Results 1 to 7 of 7

Thread: Can I use threads in visual basic 6?

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2002
    Posts
    2

    Question Can I use threads in visual basic 6?

    Hi!

    I'm developing Activex component in visual basic 6 and it need to used a thread in it.

    Can I use threads in?
    How can I do it?

    thanks

    cnavas

  2. #2
    Lively Member
    Join Date
    Aug 2002
    Posts
    126
    u can take advantage of threads only in ActiveX EXE.
    when u create ActiveX EXE, u can specify weather u want new thread for each client, a pool of threads or single thread to all of the clients.
    an ActiveX DLL always run in the thread who create it (STA), it means that it cannot accessed concurrently by two or more clients.
    VB don't give u the freedom to create COM object that can handle multiple calls concurrently (ie MTA object).
    so take care of creating ActiveX EXE, because the objects creating in a different process, and matters like marshaling overhead etc. must considered.

  3. #3
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    you can be API i think...

  4. #4
    Frenzied Member
    Join Date
    Jul 2002
    Posts
    1,370
    You can call CreateThread() in VB -it's a VB function. But you can only use it when you compile to pcode.

  5. #5
    Lively Member
    Join Date
    Aug 2002
    Posts
    126
    i read the comments that the other fellows suggest and i have something very important to say:
    don't ever use the function CreateThread in vb.
    u should read and understand very well COM Apartments before get writing some thread code.
    link to the following for more info:

    http://www.desaware.com/articles/threadingL3.htm

    http://codeguru.earthweb.com/activex...artments1.html

  6. #6

    Thread Starter
    New Member
    Join Date
    Sep 2002
    Posts
    2

    Smile Thank you very much

    Thanks for your help!

  7. #7
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    the api is not very stable though.
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

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