Results 1 to 5 of 5

Thread: Multiple Processes

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Oct 2000
    Posts
    25

    Question

    Is it at all possible to spawn off a second process in visual basic. Basically I am communicating with an external device and I need to stick some sleeps into the transmission subroutine. The issue with this is when it polls the devices the entire forms is also sleeping when I call my function. So is there a way I can stick a delay into the serial transmission to delay it by about 500 ms, 4 times or would I be able to kick off a new process that will run it in the background?
    Mark Wight
    x86 ASM, AS11 ASM, C, C++, Java.

  2. #2
    Hyperactive Member
    Join Date
    Nov 2000
    Location
    Mexico City
    Posts
    306

    Wink

    I don´t think you can do that. One way to avoid the problem is to make a second exe with the background process and in your main process call it with a shell and use DoEvents.
    If things were easy, users might be programmers.

  3. #3
    Fanatic Member crispin's Avatar
    Join Date
    Aug 2000
    Location
    2 clicks west of a Quirkafleeg...Cornwall, England
    Posts
    754

    Post

    What you are talking about is Multithreading, I take it you want to start your process on a background thread, and not have it interrupt your current process...
    Multithreading is v.complex, good if you get it right, v.bad if you get it wrong. Enough from me, go to http://www.desaware.com (home of Dan Appleman - API Legend) There are plenty of articles there about this.

    Good Luck!!
    Crispin
    VB6 ENT SP5
    VB.NET
    W2K ADV SVR SP3
    WWW.BLOCKSOFT.CO.UK

    [Microsoft Basic: 1976-2001, RIP]

  4. #4
    Hyperactive Member tumblingdown's Avatar
    Join Date
    Mar 2000
    Posts
    362
    one cheap way to get the effect is to have a seperate aX exe, apartment threaded, to spawn off your jobs. Even then, you have to watch yourself.


    td.
    "One logical slip and an entire scientific edifice comes tumbling down." - Robert M. Pirsig


    [email protected]

    "but if Einstein is right and God is in the details, reality requires that we sometimes get religion." - Scott Meyers.

  5. #5
    Hyperactive Member tumblingdown's Avatar
    Join Date
    Mar 2000
    Posts
    362
    btw, that only simulates multithreading, in certain circumstances.



    td.


    "One logical slip and an entire scientific edifice comes tumbling down." - Robert M. Pirsig


    [email protected]

    "but if Einstein is right and God is in the details, reality requires that we sometimes get religion." - Scott Meyers.

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