I want to start a VB .exe (in a thread), and have it run to completetion exclusively. Is there any to do this? So, I basically want the code to pause while this executable runs. Thanks for the help.
hanumanth reddy
Ranch Hand
Joined: Jun 12, 2000
Posts: 118
posted
0
if u want to finish the current thread to its completion
use thread.join() method
<a href="http://www.jobklub.com" target="_blank" rel="nofollow">http://www.jobklub.com</a><br /> 'Add Job To Life'
Carl Trusiak
Sheriff
Joined: Jun 13, 2000
Posts: 3340
posted
0
This actually looks to me to be a job for RunTime exec method. A program like the following should work String s; int len; byte[] buf = new byte[1000]; Process proc; InputStream inDat InputStream inErr try{ proc = Runtime.getRuntime().exec("<your vb program here>"); inErr = proc.getInputStream(); inDat = proc.getInputStream(); while((len=inDat.read(buf) > 0) { s = new String(buf,0,len); // do what you want with s } proc.waitFor(); } catch(IOException e){} }catch(InterruptedException ie){}