For Programmers: Free Programming Magazines  


Home > Archive > PowerBuilder > January 2007 > PB9 - PB10.5 Function not work









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author PB9 - PB10.5 Function not work
Paolo I-SAVO

2006-12-14, 4:16 am

Good morning to all

in PB9 I used a function declared like external function in order to open a
PDF file into my application.
The function is:

FUNCTION long ShellExecuteA( ulong hWnd, string Operation, string lpFile,
string lpParameters, string lpDirectory, int nShowCmd ) LIBRARY
"shell32.dll"


and I call it with the follow line

ShellExecuteA( 0 , "open", ls_FileName , ls_null, ls_null, 1 )


With PB9 the function work very well. In PB 10.5 it doesn't work. When I
press the button nothing to do.

Why?

Thanks a lot in advance


daengh

2007-01-16, 6:23 pm

Are you checking the return code?

Do you see any errors in the Event Viewer? Perhaps your PDF renderer installation has gone south.

Since you're passing in '0' as the first parameter, there's no place for error messages to go. Try passing 'Handle (this)' instead.
dhauze@hotmail.com

2007-01-16, 10:07 pm

Powerbuilder 10.5 uses Unicode instead of ASCII. Change your function
to ShellExecuteW. This should fix your problem.

On Dec 14 2006, 2:26 am, "Paolo I-SAVO" <NOS...@NOSPAM.it> wrote:
> Good morning to all
>
> in PB9 I used a function declared like external function in order to open a
> PDF file into my application.
> The function is:
>
> FUNCTION long ShellExecuteA( ulong hWnd, string Operation, string lpFile,
> string lpParameters, string lpDirectory, int nShowCmd ) LIBRARY
> "shell32.dll"
>
> and I call it with the follow line
>
> ShellExecuteA( 0 , "open", ls_FileName , ls_null, ls_null, 1 )
>
> With PB9 the function work very well. In PB 10.5 it doesn't work. When I
> press the button nothing to do.
>
> Why?
>
> Thanks a lot in advance


Paolo I-SAVO

2007-01-23, 8:06 am

Problem resolved.....
thank you very very much

<dhauze@hotmail.com> ha scritto nel messaggio
news:1168974206.072098.9490@11g2000cwr.googlegroups.com...
> Powerbuilder 10.5 uses Unicode instead of ASCII. Change your function
> to ShellExecuteW. This should fix your problem.
>
> On Dec 14 2006, 2:26 am, "Paolo I-SAVO" <NOS...@NOSPAM.it> wrote:
open a[color=darkred]
lpFile,[color=darkred]
>



Aemenlem88

2007-01-23, 1:15 pm

Check my blog:
http://jayna-blog.info/
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com