Bug? - ReadProgramString() and unicode

Just starting out? Need help? Post your questions and find answers here.
Justin
Addict
Addict
Posts: 948
Joined: Sat Apr 26, 2003 2:49 pm

Re: Bug? - ReadProgramString() and unicode

Post 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
Last edited by Justin on Tue Apr 27, 2010 9:21 pm, edited 1 time in total.
c4s
Addict
Addict
Posts: 1981
Joined: Thu Nov 01, 2007 5:37 pm
Location: Germany

Re: Bug? - ReadProgramString() and unicode

Post 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. ;)
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!
Justin
Addict
Addict
Posts: 948
Joined: Sat Apr 26, 2003 2:49 pm

Re: Bug? - ReadProgramString() and unicode

Post 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.
c4s
Addict
Addict
Posts: 1981
Joined: Thu Nov 01, 2007 5:37 pm
Location: Germany

Re: Bug? - ReadProgramString() and unicode

Post 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.)
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!
Post Reply