Page 1 of 1

Do "Non-Unicode apps" only work with "encoding Plain text"?

Posted: Fri Dec 17, 2010 9:35 pm
by Marco2007
Hi,

my app is non-unicode (because I use Gnozal`s PurePop3).
Now I want to use a commandline-tool (with RunProgram()) -> but that tool works only in Unicode-Mode.

I didn`t know, that running a unicode-commandline-app with RunProgram() must be compiled in Unicode-Mode...

Is there something, I can do?

br and thx

Re: Non-Unicode app -> Can I use Runprogram() in Unicode?

Posted: Fri Dec 17, 2010 9:47 pm
by KJ67
Peeks() & PokeS() could work for you, they have flags that should let you translate the strings.

Re: Non-Unicode app -> Can I use Runprogram() in Unicode?

Posted: Fri Dec 17, 2010 9:53 pm
by ts-soft
I think this should work:

Code: Select all

Import "shell32.lib"
  ShellExecuteW(hwnd.i, lpOperation.p-Unicode, lpFile.p-Unicode, lpParameters.p-Unicode, lpDirectory.p-Unicode, nShowCmd.i)
EndImport
Greetings - Thomas

Re: Non-Unicode app -> Can I use Runprogram() in Unicode?

Posted: Fri Dec 17, 2010 9:56 pm
by Trond
I don't see why RunProgram() shouldn't work for you. You can run a unicode program with it (from an ascii program).

Re: Non-Unicode app -> Can I use Runprogram() in Unicode?

Posted: Fri Dec 17, 2010 10:22 pm
by PMV
do you only need to run the tool or do you need to read output/ write input?

Re: Non-Unicode app -> Can I use Runprogram() in Unicode?

Posted: Fri Dec 17, 2010 10:34 pm
by Marco2007

Code: Select all

RunProgram("tiff2pdf.exe", "−o "+output$+" "+input$, "")
works only, when I compile in Unicode-mode.
http://www.libtiff.org/
You can run a unicode program with it (from an ascii program).
That`s what I thought, too...

@Thomas: -> also just works, only when Unicode is on...
@KJ67: Let me try...

Re: Non-Unicode app -> Can I use Runprogram() in Unicode?

Posted: Fri Dec 17, 2010 11:19 pm
by Trond
Marco2007 wrote:

Code: Select all

RunProgram("tiff2pdf.exe", "−o "+output$+" "+input$, "")
works only, when I compile in Unicode-mode.
http://www.libtiff.org/
Maybe output$ or input$ contains unicode characters? If the filenames contain unicode characters it won't work in ascii mode.

Re: Non-Unicode app -> Can I use Runprogram() in Unicode?

Posted: Fri Dec 17, 2010 11:31 pm
by Marco2007
@Trond:
F:\MailBB\IMAGE000.TIF
F:\MailBB\IMAGE000.PDF

....I`m so sad :-(

Non-Unicode apps have to be compiled with "encoding Plain te

Posted: Sat Dec 18, 2010 9:10 am
by Marco2007
Changed Encoding UTF-8 to Encoding Plain Text -> now it works.

Do "Non-Unicode apps" only work with "encoding Plain text" (even when there are no Unicode-chars in the code)?

-> changed Topic-Title.