Hi. I try to read output from a program. When I am using both ReadProgramData or ReadProgramString my app crashes. Any idea why it might occur?
Sent from my Redmi Note 4 using Tapatalk
Reading program output
Re: Reading program output
Who knows, because you didn't post any code to show what you're doing.Gushasad wrote:Any idea why it might occur?
Re: Reading program output
Hey!Dude wrote:Who knows, because you didn't post any code to show what you're doing.Gushasad wrote:Any idea why it might occur?
Here is my code, I think the error is somewhere in these lines:
ADBID = RunProgram ("adb.exe","reboot sideload","", #PB_Program_Read)
Debug ReadProgramString(adbid, #PB_UTF8)
Re: Reading program output
always check the return value of RunProgram()
See: https://www.purebasic.com/documentation ... ogram.htmlPureBasic Dokumentation wrote:Return value
Nonzero if the program has been successfully launched, zero otherwise.
Hygge
Re: Reading program output
Check what Kiffi said
And maybe you need
And maybe you need
Code: Select all
ADBID = RunProgram ("adb.exe","reboot sideload","",#PB_Program_Open | #PB_Program_Read)
Egypt my love
Re: Reading program output
Maybe your code (which you not show) is wrong.Gushasad wrote:Hi. I try to read output from a program. When I am using both ReadProgramData or ReadProgramString my app crashes. Any idea why it might occur?
But my crystal ball stays nebulous.
So I can not help you.
Re: Reading program output
Yeah, it worked. I needed to use the Open flag. Thanks!