-
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?
-
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.
-
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!!
-
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.
-
btw, that only simulates multithreading, in certain circumstances.
td.