1. Daniel Ferrreira
  2. PowerBuilder
  3. Friday, 15 May 2020 14:31 PM UTC

Hi guys,

I have an app that uses the GetFileOpenName method.

This app used to be a .net target, because it calls a .net dll. I did 2 things to this app: I used the new PB 2019 R2 .net nvo calling (so it's now a classic PB target) and moved it from PB 2019 to 2019 R2.

The issue is that I use this GetFileOpenName to get a list of files. Each file is named alike, like this example: 41131085031995000100550010000933131766531488-procNFe.xml. Sometimes I load only 1 file, sometimes thousands.

The issue that come up is that the PB/GetFileOpenName interface seems to have a size limitation now. With files named like the example above, the return array of file names only brings back around 600 files, and the path variable brings back garbage text.

ll_ret = GetFileOpenName('XML', ls_path, ls_fileName[], 'xml', 'XML Files (*.xml),*.xml', ls_dirImportXML)

This used to work before my 2 described changes. I even tried to pre-load the variables ls_path with Space(1000) and ls_fileName[] with a 1000 long, 1000 spaces array, but got the same result. If the file names are shorter, I can get more files on the array, but it still crops the selection and brings back garbage on ls_path.

Do any of you know a workaround, if it's me making a mistake or any other ideas?

Thanks,
Daniel

Accepted Answer
Daniel Ferrreira Accepted Answer Pending Moderation
  1. Friday, 15 May 2020 18:47 PM UTC
  2. PowerBuilder
  3. # Permalink

Thanks John,

I'll let you know.

Comment
There are no comments made yet.
Daniel Ferrreira Accepted Answer Pending Moderation
  1. Friday, 15 May 2020 19:39 PM UTC
  2. PowerBuilder
  3. # 1

John, thanks, no luck.

I used Rolands nvo on my app. I was able to choose 1, then 2, then 2 groups of 350 (I created a test directory with 700 xml files on it). When I tried to select all 700 of them, my app just crashed (i was on debug mode). Tried again without debug, but through PB, same result.

Tried Rolands sample app directly, through PB, and it briefly showed me a "error 12xxxx" (i don't recall the exact number), and then crashed. I tried to execute it again, to get the error number, but even generating an exe of Rolands getfilename (I tried both 32 and 64bit), it just closes, doesn't display an error msg or anything. :(

But now, I think it's a Windows issue. I used Rolands PBL 10.5 with my old PB12.5, and the same thing happened. I added a button to the window, calling the GetFileOpenName, and it didn't crash, but it only returned 587 files, and the same garbage on the path variable.

 

Comment
  1. John Fauss
  2. Friday, 15 May 2020 20:17 PM UTC
I'm sorry to hear it did not work out better for you, Daniel.



Maybe you will need to create your own "FileOpenName" window??? Then you could return a DataStore containing all of the selected file path/names.
  1. Helpful
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Friday, 15 May 2020 16:31 PM UTC
  2. PowerBuilder
  3. # 2

Greetings, Daniel - 

You might consider replacing the PowerScript GetOpenFileName function/dialog.

Check out the "GetFileName" free sample app on Roland Smith's TopWizProgramming web site:

https://www.topwizprogramming.com/freecode_getfilename.html

It uses WinAPI calls to open the Windows dialog instead of the PB version. I have used it and it works nicely, but I've not tried the particular scenario that you have described. Worth a look!

Regards, John

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.