
determining if a shelled program has ended execution (vb3.0)
Quote:
> : I've got the stuff from the knowledge base:
> :
> : Use a function called GetModuleUsage:
> : Declare Function GetModuleUsage% Lib "Kernel" (ByVal hModule%)
> :
> : and use it like this:
> : h=shell("MYPROG.EXE")
>. : while GetModuleUsage(h)>0
>. : DoEvents
> : wend
The GetModuleUsage is a 16 BIT API call!!!!
Your environment is running 32 bit code?
Any questions?
Quote:
> I have a Shell command problem in a VB4 application running under
NT:
> x = shell("command.com /c mycmd < myinput >myoutput", 0)
> open myoutput for input as 1
> ' I want to read the content of myoutput and write it to a textbox
> It turned out that the content of the previous version of myoutput
was shown
> instead of the one from the latest run of that shell command. It
seemed
> that the I/O redirection will not be completed until the VB
application is
> terminated.
How about "killing" the shelled process which should
flush I/O buffers.
Another idea might be to use a "memory mapped" file to do your
I/O. It would have some speed advantages as your reading/writing
RAM instead of SLOW disks.
I think there was some code examples in a recent VB Prog.Journal
last 3-4 months. I don't have my copies handy.
Quote:
> So I force the VB code to wait for the completion of Shell as
illustrated by
> Mr. Behr. But the de{*filter*} stopped at his While statement. Is there
> anything wrong with his code?
I have ran into problems Debugging 32 bit code in the Borland
environment also the Breakpoints that I set in the De{*filter*} never
get reached or so it seemed, all I had to do was task switch to the
de{*filter*} and the program was stopped right where I set the
breakpoint.
I think this is because in 32 bit processes the address space of all
processes are shall we say "private".
Quote:
> How may I force the completeion of I/O redirection in Shell before I
open it
> to read?
> Jim Kung
> Norfolk State University
___________________________________________
If Pro is the opposite of Con.
What is the opposite of Progress?