Page 2 of 2
Re: Bug? - ReadProgramString() and unicode
Posted: Mon Apr 26, 2010 11:48 pm
by Justin
#LFs are not sent in the progress line so the previous functions don't work. I did a new version that handles #CRLF and #CR. Why do you need ProgramRunning(), CloseProgram()?Btw, with the PB functions empty lines are lost.
edit: code removed use previous include
Re: Bug? - ReadProgramString() and unicode
Posted: Tue Apr 27, 2010 11:27 am
by c4s
I need it because I have to replace all the PureBasic functions I'm using right now to be able to handle a nonunicode executable with my unicode program. KillProgram() would be the last function I need.
Anyway, thanks for your great help so far! You know I'm not the best API programmer.

Re: Bug? - ReadProgramString() and unicode
Posted: Tue Apr 27, 2010 9:26 pm
by Justin
The program is running until there is no more data to read then it closes. GetExitCodeProcess() will return always #STILL_ACTIVE if you don't read data. I added proc_TerminateProcess() wich kills the program at any time, it is in the first include i posted, i removed the rest of the code.
Re: Bug? - ReadProgramString() and unicode
Posted: Tue Apr 27, 2010 9:42 pm
by c4s
I found out that GetExitCodeProcess() works better for me because there are executables that don't give out (error) strings all the time.
What do you mean with it always returns #STILL_ACTIVE? Reading msdn I thought it's a good way to check it.
(Well, I read a post from Freak some days ago where he posted something like waitobject or so would be better. Didn't test it yet.)