1. ORESTE MUSCELLA
  2. PowerBuilder
  3. Wednesday, 3 March 2021 16:32 PM UTC
 
Hi everyone,
I'm new to this community and haven't used PowerBuilder in my work for a while.
 
When deploying on 64bit I have a problem with the use of the external function "User32.dll" such as with the "getSubMenu" function which always returns 0.
 
Can anyone give me some guidance to solve this problem.
 
Thanks in advance (sorry for my english)
Oreste
 
sorry i am using PB2019R3
John Fauss Accepted Answer Pending Moderation
  1. Wednesday, 3 March 2021 17:15 PM UTC
  2. PowerBuilder
  3. # 1

Hi, Oreste -

API functions calls can be different in 64-bit, because the datatypes Windows uses for some values (like pointers and handles, for example) are 64-bit instead of 32-bit.

Here is the external function declaration (EFD) you should use for the GetSubMenu WinAPI function:

FUNCTION Longptr GetSubMenu ( &
   Longptr hMenu, &
   Long    nPos &
   ) LIBRARY "user32.dll"

If you are not familiar with the Longptr datatype, it gets translated during compile-time to either a Long (32-bit) or LongLong (64-bit). Obviously, you then have to change the code that calls the external function to use the appropriate datatypes.

I've written a four-part tutorial about interfacing PB to the Windows API, which is available in Tech Articles section of the Articles & Blogs portion of the Appeon Community web site, if you're interested.

Regards, John

Comment
  1. ORESTE MUSCELLA
  2. Thursday, 4 March 2021 12:50 PM UTC
Hello John,

thanks for the clarification, I will try to make the changes you suggest and then I will carefully study your tutorials.



Best Regards

Oreste
  1. Helpful
There are no comments made yet.
Armeen Mazda @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 3 March 2021 16:55 PM UTC
  2. PowerBuilder
  3. # 2

64-bit project cannot use 32-bit DLLs, and this generally applies to everything.  For example, you must use 64-bit DB driver for 64-bit compiled app.

I don't think it is trivial undertaking to migrate existing project to 64-bit, but if you really want to do it John's Tech Articles are useful.  You should also be looking at the product documentation and the Elevate tech session regarding 64-bit migration. 

Here are the various links:

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.