- Henry Guo
- PowerBuilder
- Friday, 26 April 2024 02:43 PM UTC
I migrated our client's application from PowerBuilder 2017 32-bit to PowerBuilder 2022 64-bit, the below code are under Local External Functions declaration in a user object, the below code can successfully run in PowerBuilder 2017 32-bit, but after I migrated to PowerBuilder 2022 64-bit, it causes error when call the below external functions in the code, what should be changed for the below code?
Thanks for your helps!
// WSOCK32.DLL
FUNCTION int accept (int s, REF str_SockAddr addr, REF int addrlen) LIBRARY "WSOCK32.DLL" alias for "accept;Ansi"
FUNCTION int bind (int s, REF str_SockAddr addr, int addrlen) LIBRARY "WSOCK32.DLL" alias for "bind;Ansi"
FUNCTION int closesocket (int s) LIBRARY "WSOCK32.DLL"
FUNCTION int connect_alias (int s, REF str_SockAddr addr, int ilength) LIBRARY "WSOCK32.DLL" alias for "connect;Ansi"
FUNCTION int ioctlsocket (int s, long cmd, REF long arg) LIBRARY "WSOCK32.DLL"
FUNCTION int getpeername (int s, REF str_SockAddr addr , REF int addrlen) LIBRARY "WSOCK32.DLL" alias for "getpeername;Ansi"
FUNCTION int getsockname (int s, REF str_SockAddr addr, REF int addrlen) LIBRARY "\WSOCK32.DLL" alias for "getsockname;Ansi"
FUNCTION int getsockopt (int s, int level, int optname , REF char optval, REF int optlen) LIBRARY "WSOCK32.DLL" alias for "getsockopt;Ansi"
FUNCTION long htonl (long hostlong) LIBRARY "WSOCK32.DLL"
FUNCTION int htons (int hostshort) LIBRARY "WSOCK32.DLL"
FUNCTION long inet_addr (string cp) LIBRARY "WSOCK32.DLL" alias for "inet_addr;Ansi"
FUNCTION long inet_ntoa (long in ) LIBRARY "WSOCK32.DLL"
FUNCTION int listen (int s, int backlog) LIBRARY "WSOCK32.DLL"
FUNCTION long ntohl (long netlong) LIBRARY "WSOCK32.DLL"
FUNCTION int ntohs (int netshort) LIBRARY "WSOCK32.DLL"
FUNCTION int recv (int s, REF string buf , int buflen, int flags) LIBRARY "WSOCK32.DLL" alias for "recv;Ansi"
FUNCTION int recvfrom (int s, string buf , int buflen, int flags, REF str_SockAddr fromsocket , REF int fromlen) LIBRARY "WSOCK32.DLL" alias for "recvfrom;Ansi"
FUNCTION int select_alias (int w, REF fd_set readfds, REF fd_set writefds, REF fd_set exceptfds, REF timeval timeout) LIBRARY "FTPNETVC.DLL" alias for "select_alias;Ansi"
FUNCTION int send (int s, string msg, int msglen, int flags) LIBRARY "WSOCK32.DLL" alias for "send;Ansi"
FUNCTION int sendto (int s, string msg, int msglen, int flags, REF str_SockAddr addr, int addrlen) LIBRARY "WSOCK32.DLL" alias for "sendto;Ansi"
//FUNCTION int setsockopt (int s, int level, int optname, REF int optval, int optlen) LIBRARY "WSOCK32.DLL"
FUNCTION int shutdown (int s, int how) LIBRARY "WSOCK32.DLL"
FUNCTION int socket (int domain, int domaintype, int protocol) LIBRARY "WSOCK32.DLL"
// Database Functions
FUNCTION long gethostbyaddr(REF string addr, int addrlen, int addrtype) LIBRARY "WSOCK32.DLL" alias for "gethostbyaddr;Ansi"
FUNCTION long gethostbyname(Ref string host) LIBRARY "WSOCK32.DLL" alias for "gethostbyname;Ansi"
FUNCTION int gethostname(REF string host, int hostlen) LIBRARY "WSOCK32.DLL" alias for "gethostname;Ansi"
FUNCTION long getservbyport(int port, REF string proto) LIBRARY "WSOCK32.DLL" alias for "getservbyport;Ansi"
FUNCTION long getservbyname(REF string service, REF string proto) LIBRARY "WSOCK32.DLL" alias for "getservbyname;Ansi"
FUNCTION long getprotobynumber(int proto) LIBRARY "WSOCK32.DLL"
FUNCTION long getprotobyname(REF string proto) LIBRARY "WSOCK32.DLL" alias for "getprotobyname;Ansi"
// Microsoft Windows Extensions
FUNCTION int WSAStartup(int wVersionRequired, REF str_WSAData lpstr_WSAData) LIBRARY "WSOCK32.DLL" alias for "WSAStartup;Ansi"
FUNCTION int WSACleanup() LIBRARY "WSOCK32.DLL"
SUBROUTINE WSASetLastError(int iError) LIBRARY "WSOCK32.DLL"
FUNCTION int WSAGetLastError() LIBRARY "WSOCK32.DLL"
FUNCTION int WSAIsBlocking() LIBRARY "WSOCK32.DLL"
FUNCTION int WSAUnhookBlockingHook() LIBRARY "WSOCK32.DLL"
FUNCTION long WSASetBlockingHook() LIBRARY "WSOCK32.DLL"
FUNCTION int WSACancelBlockingCall() LIBRARY "CWINSOCK.DLL"
FUNCTION int WSAAsyncGetServByName(uint hWnd, uint msg, REF string aName, REF string proto, REF string buf, int buflen) LIBRARY "WSOCK32.DLL" alias for "WSAAsyncGetServByName;Ansi"
FUNCTION int WSAAsyncGetServByPort(uint hWnd, uint wMsg, int port, string proto, REF string buf, int buflen) LIBRARY "WSOCK32.DLL" alias for "WSAAsyncGetServByPort;Ansi"
FUNCTION int WSAAsyncGetProtoByName(uint hWnd, uint wMsg, REF string aName, REF string buf, int buflen) LIBRARY "WSOCK32.DLL" alias for "WSAAsyncGetProtoByName;Ansi"
FUNCTION int WSAAsyncGetProtoByNumber( uint hWnd, uint wMsg, int aNumber, REF string buf, int buflen) LIBRARY "WSOCK32.DLL" alias for "WSAAsyncGetProtoByNumber;Ansi"
FUNCTION int WSAAsyncGetHostByName(uint hWnd, uint wMsg, REF string aName, REF string buf, int buflen) LIBRARY "WSOCK32.DLL" alias for "WSAAsyncGetHostByName;Ansi"
FUNCTION int WSAAsyncGetHostByAddr(uint hWnd, uint wMsg, REF string addr, int addrlen, int addrtype, REF string buf, int buflen) LIBRARY "WSOCK32.DLL" alias for "WSAAsyncGetHostByAddr;Ansi"
FUNCTION int WSACancelAsyncRequest(uint hAsyncTaskHandle) LIBRARY "WSOCK32.DLL"
FUNCTION int WSAAsyncSelect(int s, uint hWnd, uint wMsg, long lEvent) LIBRARY "WSOCK32.DLL"
// NMPCIP.DLL
FUNCTION long dllVer() LIBRARY "NMPCIP.DLL"
// FTPNET.DLL
//FUNCTION long BeeperFTPNET(int nOpCode) LIBRARY "FTPNETVC.DLL"
//FUNCTION long ResolveAddressFromName(REF str_SockAddr sa_in, long he) LIBRARY "FTPNETVC.DLL"
// kernal
SUBROUTINE CopyStrMemory(REF str_hostent l_dest, long l_source, long l_cbcopy) LIBRARY "kernel32" alias for "RtlMoveMemory;Ansi"
SUBROUTINE CopyMemory(REF long l_dest, long l_source, long l_cbcopy) LIBRARY "kernel32" alias for "RtlMoveMemory"
SUBROUTINE hmemcpy(REF long l_dest, long l_source, long l_cbcopy) LIBRARY "kernel32"
SUBROUTINE StrCpy(REF string l_dest, long l_source) LIBRARY "kernel32" alias for "StrCpy;Ansi"
SUBROUTINE waitmessage() LIBRARY "kernel"
FUNCTION integer GetPrivateProfileString(REF string appname, REF string keyname, REF string default, REF string returnedstring, integer size, REF string filename) LIBRARY "kernel" alias for "GetPrivateProfileString;Ansi"
FUNCTION integer WritePrivateProfileString(REF string appname, REF string keyname, REF string newstring, REF string filename) LIBRARY "kernel" alias for "WritePrivateProfileString;Ansi"
FUNCTION boolean DestroyWindow(int w_handle) LIBRARY "kernel"
FUNCTION long GetFreeSpace(int w_handle) LIBRARY "kernel"
FUNCTION int GetFreeSystemResources(int SysResource) LIBRARY "kernel"
FUNCTION long GlobalCompact(long MinFree) LIBRARY "kernel"
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.