Skip to content

How to correctly use TJvCreateProcess to redirect "cmd.exe" for input and output forever in windows console program ? #167

Answered by sum2012
sum2012 asked this question in Q&A
Discussion options

You must be logged in to vote

In delphi ,I take a search with "CreateProcess crash with STARTF_USESTDHANDLES",I see "ANSICHAR thing" so that I change to CreateProcessA.
It finally can run
https://gist.github.com/sum2012/a64478bde210ac40c110f5e4cbdc9f98
But it is same result with TJvCreateProcess,You need input 2 times of command (dir) to see the output.
edir:Get lucky fixed.
Change to if ReadFile(FReadPipe, Buffer, SizeOf(Buffer)-1, BytesRead, nil) then
https://gist.github.com/sum2012/0891864a43a5ab90b1386e48ff459537
I am not interested to fix TJvCreateProcess

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by sum2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant