Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
PROCESS.VCX (API_APPRUN)
Message
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00225698
Message ID:
00226456
Views:
30
>Dragan,
>
>The freezip.exe syntax is very similar to that of pkzip but not quiet. The help for the command line is vague and the readme.txt says it will not answer any email regarding the command line syntax. What happened to the days when you got what you paid for? ;-)>>>
>
>I tried the @listfile.txt method from the command line and that didn't work. The only thing that worked from the DOS command line was -@ destination.zip < listfile.txt. That also worked using the VPF RUN command but it doesn't work using API_APPRUN.
>
>I tried every possibility to get this systax to run using API_APPRUN but it never would. I even tried every possible change in the PIF file as well. The reason I used re-direction to begin with was to not have a succession of DOS windows opening and closing. But since you can hide the DOS window with API_APPRUN, what I did was to use the same code that I had in place to build the listfile.txt to run successive zip.exe commands with the same destinatin but different source files; appending each as I go. This works fine and so I've stopped trying to get the DOS re-direction function to work with API_APPRUN.
>

With a little tweaking, you can redirect STDIN, STDERROR and STDOUT through the STARTUPINFO structure. The last three DWORDs of the STARTUPINFO structure can contain file handles to be passed to the new process to redirect the STDIN, STDOUT and STDERROR of the new process respectively. You'd need to open the source for STDIN in your process, set an additional bit in the STARTUPINFO dwFlags member to indicate that you wanted to override the stard I/O (you'd OR the current value of the dwFlags member with 0x0100), convert the handle to a DWORD (a 4 byte string representing an unsigned 32 bit integer integer) and put the DWORD into the STARTINFO structure at the correct offset in the structure. If you look at the source for API_APPRUN, you can see where I build the structure in the LaunchApp method.

>All in all I'm real happy to have found the API_APPRUN class. It really makes for a much cleaner appeareance and much better control then the Fox RUN command.
>
>Ed
>
>>>In VFP6.0 SP3 I can run the program with the line
>>>RUN zip.exe -@ atest.zip < atest.txt
>>>
>>>The systax is zip
>>>In this case the -@ means to take the source from stdin and, using the DOS piping symbol, the stdin is a text file with a list of the files to be zipped.
>>
>>I've always used this syntax for PkZip:
>>
>>
pkzip whatever @listfile.txt
>>
>>No need for any redirection, and should run fine without a window.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform