1. Timothy Beck
  2. PowerBuilder
  3. Thursday, 5 April 2018 21:20 PM

With my PB 12.5 app, I had coded a call to the Windows API GetOpenFileName function that worked perfectly. When I compile that same app in PB 2017 64Bit, it doesn't work because of a structure size error. Can you point me to some code (or someone) that might help me figure out what changes I need to make to get it to work?

Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Thursday, 5 April 2018 21:38 PM
  2. PowerBuilder
  3. # 1

Hi Timothy;

     Yes, the 64 bit world on the GetFileOpen ( ) Windows API call is different in the 64 bit world vs 32 bit world. It took me a while when PB 12.6 came out to tweak my Integrated framework's 32 bit code to make it work OK in the 64 bit realm. However, I finally  figured it out. You are most welcome to download the framework and either use it directly or extract the code you need.   wink

     The key areas to look at are:

  • PBL:            STD_FC_Base2.pbl (objects specific to 64 bit or native only PB)
  • Structure:   sr_browseinfo64
  • Object:       nc_app_controller64_master
  • Method:     of_browse_for_folder ( ) .... for its implementation

Note: The ancestor "nc_app_controller_master" same method will show you the 32 bit implementation.

Use: Instantiate   nc_app_controller64_master and then call the  of_browse_for_folder ( ) method from anywhere in your App.

Tip: Try the OrderEntry Example framework App to see the actual coding working from its 64 bit EXE.


Regards ... Chris



Thanks!  Unfortunately, the example calls SHBrowseForFolder, not GetOpenFileName or GetSaveFileName.  Do you have examples of those?

I do see the changes you made to the structure.  How did you decide when to use Long and when to use LongPtr?  


  1. Timothy Beck
  2. Friday, 6 April 2018 15:42 PM

   You need to use the new pointer data type for the 64bit realm. I found this requirement while reading the 64bit API documentation.

   PB 12.x extended the built-in GetFileOpenName ( ) method addiing a new aFlag argument. This argument controls the Look & Feel and behaviour of the O/S dialog. Have you tried this aspect?

Regards ... Chris

  1. Chris Pollach @Appeon
  2. Friday, 6 April 2018 17:42 PM

Thanks again ... I did try setting the aFlag argument to various things without getting the desired results.


  1. Timothy Beck
  2. Friday, 6 April 2018 18:15 PM
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.