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--------------