Hello,
I have a question regarding unicode and ascii.
My program is in unicode, but at one point it calls another exe with RunProgram().
This exe is ascii only.
I need to pass a parameter string, and read the program output and error.
If I compile in ascii it works, compiled in unicode it does not.
I already tried to convert the unicode strings to ascii before I pass them over, but that does not help.
My unicode/ascii conversion works for other parts of the program, so I guess I do soemthing wrong when using RunProgram.
Any ideas?
Thanks
call asci programs from unicode program
call asci programs from unicode program
PB 5.40 LTS, W7,8,10 64bit and Mint x64
Re: call asci programs from unicode program
you have to use WriteProgramData() and ReadProgramData()!
you can't use the stringbased functions.
greetings
Thomas
you can't use the stringbased functions.
greetings
Thomas
Re: call asci programs from unicode program
Thanks Thomas.
I do that as much as possible.
But how to call the program?
I need to pass the param$ in ascii and read the ReadProgramError() as well.
This code works when I compile in ascii.
I do that as much as possible.
But how to call the program?
I need to pass the param$ in ascii and read the ReadProgramError() as well.
Code: Select all
pid=RunProgram(program$,param$,"",#PB_Program_Hide|#PB_Program_Open|#PB_Program_Read|#PB_Program_Error)
*deviceinfo=AllocateMemory(1024)
pok=0
For p=0 To passwordTimeout
Delay(10)
If IsProgram(pid)
e$=ReadProgramError(pid)
If e$
Debug e$
EndIf
If AvailableProgramOutput(pid)
ReadProgramData(pid,*deviceinfo,1024)
pok=1
Else
If pok=1
Break;
EndIf
EndIf
EndIf
Next
PB 5.40 LTS, W7,8,10 64bit and Mint x64
Re: call asci programs from unicode program
You have nothing to change on params$!
ReadProgramError() is a problem.
ReadProgramError() is a problem.
Re: call asci programs from unicode program
Here is the workaround I'm using right know:
http://www.purebasic.fr/english/viewtop ... 13&t=41952
I posted two feature requests as well:
http://www.purebasic.fr/english/viewtop ... =3&t=41979
http://www.purebasic.fr/english/viewtop ... =3&t=43470 (I probably forgot that I already posted one)
http://www.purebasic.fr/english/viewtop ... 13&t=41952
I posted two feature requests as well:
http://www.purebasic.fr/english/viewtop ... =3&t=41979
http://www.purebasic.fr/english/viewtop ... =3&t=43470 (I probably forgot that I already posted one)
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!
Re: call asci programs from unicode program
Thanks c4s!
So I hit a real problem here...
I'll look at the workarounds and see what I can make of it.
So I hit a real problem here...
I'll look at the workarounds and see what I can make of it.
PB 5.40 LTS, W7,8,10 64bit and Mint x64