|
-
Nov 17th, 2000, 10:09 AM
#1
Thread Starter
Junior Member
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.
-
Nov 17th, 2000, 10:15 AM
#2
Hyperactive Member
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.
-
Nov 17th, 2000, 10:19 AM
#3
Fanatic Member
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]
-
Nov 17th, 2000, 10:29 AM
#4
Hyperactive Member
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.
-
Nov 17th, 2000, 10:36 AM
#5
Hyperactive Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|