CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Threading in VB

  1. #1
    Join Date
    Sep 2001
    Posts
    23

    Threading in VB

    I like to create different threads for different processes in vb application. For example, I like to update the database at the same time I like to write the data to a flat file. I like to be able to do these two things separately from each other so that they don't wait for each other until one process is done. Any example or code would be helpful.

    Thanks in advance.


  2. #2
    Join Date
    Apr 2000
    Posts
    737

    Re: Threading in VB

    just to clarify. you will got only one process in a vb application, not different threads for different processes, but you can have different threads in a process.

    of course you can have multiple processes, by creating a out-of-process server (activeX exe), this is the simplest & most stable way of creating different threads in vb, unfortunately, I don't have code with me.

    but, if you are using DAO, beware, it's not thread-safe. what I normally did is create a worker thread and using SendMessage to sync across multiple thread, i.e. only one thread will write to the database, and other threads will send request to it. again, unfortunately, I did it in VC++.


    HTH

    cksiow
    http://vblib.virtualave.net - share our codes

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

Featured