Home > database >  Use the dialog box select files, path and file names are garbled
Use the dialog box select files, path and file names are garbled

Time:09-30

Pb65 code upgrade to pb11, after the open dialog box (defines a common user object), choose the files, by tracking found path and file names is gibberish, don't know what the reason is,
The open dialog box code: the code red is to get the value of the code
If GetOpenFileNameA (OpenFileName)=1 Then//press ok button
the PathName=LeftA (String (OpenFileName lpstrFile, "address"), OpenFileName. NFileOffSet - 1)
Li_Start=0
Do
Ls_Token=String (OpenFileName. LpstrFile + OpenFileName. NFileOffSet + li_Start, "address")
If ls_Token & lt;> "" Then
FileCount++
Files/FileCount=ls_Token
End the If
Li_Start +=Len (ls_Token) + 1
Loop Until ls_Token=""
FileName=Files [1]
Else

CodePudding user response:

To test whether the garbled OpenFileName lpstrFile, "address"),
Estimation is pb11 character set issues, they should have the answer you want

CodePudding user response:

left

CodePudding user response:

OpenFileName lpstrFile, "address"), the content is garbled, get on the Internet, I searched for a long time, but could not find a solution

CodePudding user response:

Left as well as get garbled, here I use leftA the file path, because I file name, file type filter it has Chinese characters

CodePudding user response:

PB itself with common dialog box!
Do you have a good look at the common user objects

CodePudding user response:

Now is to upgrade our company system, made of pb65 before, built a public user object, solve the problem of the open dialog box, there is a problem now is that the user object, if use pb itself dialog box, change the momentum is very big

CodePudding user response:

Use this statement to try
The Function long GetOpenFileName (ref OPENFILENAME pOpenfilename) LIBRARY "comdlg32. DLL" ALIAS FOR "GetOpenFileNameA"
  • Related