Home > database >  Pb11.5 ShellExecute question
Pb11.5 ShellExecute question

Time:09-24

ShellExecute in pb11.5 execution returns 2, performing in the same statement to pb9 success, what's the problem?
Procedure is as follows:
String ls_ret, ls_null
Ls_ret='E: \ err_info TXT'
Setnull (ls_null)
Messagebox (ls_ret ShellExecute (0, ls_null, ls_ret ls_null, ls_null, 1))

Are defined as follows:
The Function ulong ShellExecute (ulong HWND, ref string lpOperation, ref string lpFile, ref string lpParameters, ref string lpDirectory, ulong nShowCmd) LIBRARY "shell32. DLL" ALIAS FOR "ShellExecuteA
"

CodePudding user response:

Defined as
The Function ulong ShellExecute (ulong HWND, ref string lpOperation, ref string lpFile, ref string lpParameters, ref string lpDirectory, ulong nShowCmd) LIBRARY "shell32. DLL" ALIAS FOR "ShellExecuteA ; ANSI "

CodePudding user response:

Thank you friend, on the second floor change after solved!

Just don't know increase "ANSI" before and after what is it? To explain again, please? Thank you very much!

CodePudding user response:

PB10 the following version of the program, use ANSI string coding, PB10 or above, using the Unicode, so the API function definition, will be A little discrepancy. Most of the use of the string in the parameters or return values of Windows API functions, provide two versions of the API, A is the ANSI, generally add A marked A behind the function, A support Unicode, generally in the function W (WideChar) as A tag after it. Such as GetWindowTextA and GetWindowTextW, therefore, when pb9, define the API function is generally use the ANSI version (because pb9 use ANSI code), if it is to upgrade to the PB10 or later, you can define the API function to use Unicode version can, rather than using PB program directly upgrade, to continue using the ANSI version,

If the PB10 and above also need to define the Ansi version of the function, the need to define a function declaration; Ansi

CodePudding user response:

reference yyoinge reply: 3/f
PB10 the following version of the program, use ANSI string coding, PB10 or above, using the Unicode, so the API function definition, will be A little discrepancy. Most of the use of the string in the parameters or return values of Windows API functions, provide two versions of the API, A is the ANSI, behind the function add A marked A commonly, A support Unicode, generally in the function W (WideChar) as A tag after it. Such as GetWindowTextA and GetWind...

Positive solution!
  • Related