CreateProcessArchives Forums/BlitzPlus Programming/CreateProcess
| Mark and co,|
This seems to be an undocumented command. I can't find it anywhere, at least! Could you explain what this does, and any like commands?
| its true,its usefull|
I use it for my IDE project.
It creates a stream.
while not eof(stream)
Does it work like ExecFile ?
ExecFile returns a stream ?
| Hmm, I'm going to assume the stream contains the output from the executed program. Probably most useful for compilers.|
That's just a hunch though, not had chance to actually try it.
| Mark uses it in his Syntax Highlighter example.|
It appears the CreateProcess() function launches a program and reads back any output that program produces:
DebugLog "Blitzcc output ..."
While Not Eof(proc)
DebugLog "Blitzcc.exe not found"
| I want that in Blitz3D! Until now if I want to read the results of launching an external app I must do crappy tricks. |
| Does it read it back in realtime? Meaning that I can create a seperate program, and that program could communicate to the first via stream? Or the second program need to complete operation before the first can read the stream?|
Does the stream work both ways?
| Interesting.. how can I make a generic program communicate through this stream ?|
I tryed it running calculator, but no output has been triggered. Only, it can inform you when you close the called program, because the value red from its stream is 0.
I mean, which kind of output should be generated by the called program, in order to be red from within blitz ?
This could be extremely useful... think, just for example, a VB app that handle a database, and communicate the result of a query to a blitz app...
Any further news about this undocumented gem ?
Yep, CreateProcess launches a 'console based' app and returns a stream representing its input/output.
If the app is expecting input, you can write to the stream to automatically enter lines of input using WriteLine.
If the app is generating output, you can read back from the stream to receive the lines using ReadLine.
*Note* This only works with console based apps that using stdin/stdout. Windows apps typically generate no output.
Blitz Print/Input are supposed to use stdin/stdout, but that feature is not quite working properly yet.
| @ Mark,|
thanks a lot for your explanation.
| I'd like to see Print working...I wanted to make a silent precompiler for use with all IDE's that would automatically include an "includes" folder, but couldn't because it can't give blitzcc's feedback back to the IDE. |