1. Henry Guo
  2. PowerBuilder
  3. Saturday, 28 September 2024 19:49 PM UTC

I migrated our client's application from PowerBuilder 2017 32-bit to PowerBuilder 2022 64-bit, the below code can successfully run in PowerBuilder 2017 32-bit and PowerBuilder 2022 32-bit, but after I migrated to PowerBuilder 2022 64-bit, it causes error when call the external function(CopyStrMemory) in the below code, what should be changed for the below code to fit for 64-bit?

Thanks for your helps!

-----------str_hostent structure declaration--------------

-----------Local External Functions declaration in uo_winsockdll user object--------------

FUNCTION long inet_addr (string cp) LIBRARY "WSOCK32.DLL" alias for "inet_addr;Ansi"
FUNCTION long gethostbyname(Ref string host) LIBRARY "WSOCK32.DLL" alias for "gethostbyname;Ansi"

SUBROUTINE CopyStrMemory(REF str_hostent l_dest, long l_source, long l_cbcopy) LIBRARY "kernel32.dll" alias for "RtlMoveMemory;Ansi"

-----------Call External Function--------------

Long addr
Long an_ip
String ls_host_name = 'test_server'

addr = uo_winsockdll.inet_addr(ls_host_name)

an_ip = uo_winsockdll.gethostbyname(ls_host_name)

uo_winsockdll.CopyStrMemory(lstr_hostent, an_ip, 24)

-----------When call the above CopyStrMemory external function in 64bit PowerBuilder application, got the below error--------------

Who is viewing this page
Armeen Mazda @Appeon Accepted Answer Pending Moderation
  1. Saturday, 28 September 2024 20:14 PM UTC
  2. PowerBuilder
  3. # 1

When switching from 32-bit to 64-bit you need to modify your code to be compatible... for example changing data types, windows API calls, etc.  I recommend you carefully go through the 64-bit migration guide to have good understanding what is required to migrate successfully: https://docs.appeon.com/pb2022r3/migrating_32bit_applications_to_64bit/index.html

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.