1. Henry Guo
  2. PowerBuilder
  3. 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"

 


Responses (4)
  1. Likes
  2. Latest
  3. Oldest
Loading...

Find Questions by Tag

.EXE .NET 6.0 .NET Assembly .NET Core 3.1 .NET Core Framework .NET DataStore .NET Std Framework 32-bit 64-bit ADO.NET AEM AI Algorithm Amazon AWS Android Apache API APK App Store App Store (Apple) Appeon Workspace Appeon Xcelerator Plug-in Architecture Array ASE Asynchronous Methods Authentication AutoBuild AutoCompiler Automated Testing Automation AutoScript Azure Barcode Base64 Batch BigData BLOB Branch & Merge Browser Bug Build Button C# C# Class Importer C# Editor C# Model generator Calendar Camera Certificate Chrome Citrix Class Client Client/Server Cloud Cluster Collection COM Command Line Compiler Compression Computed Field Configuration Controls Cookies Cordova Crash Cross-Platform Crosstab CSharpAssembly CSharpObject CSS CSV Cursor Data Database Database Driver Database Painter Database Profile Database Provider DataObject DataSource DataStore DataStore (C#) DataStore (PS) DataType DataWindow DATE DATETIME DB2 Debug Debugger Debugging Deployment Design DLL DO-WHILE Dockable Docker Documentation DOUBLE Download DragDrop Edge Edit Style Editor Elevate Conference Email Embedded SQL Emulator Encoding Encryption Enhancement Request Entity Entity Framework ERP Error Event Event Handler Event Handling Excel Exception Export Expression External Functions F# Field File File Access Filter Firefox Firewall Font FOR-NEXT Foreground Format Function Garbage Collection GeoLocation Git Graph HANA Hash Header HTML/5 HTTP/S HTTPClient Icon IDE Identity IIS IMAPI Import InfoMaker Inheritance Installation Integer IntelliSense Interface Internet Internet Explorer iOS IPA iPad iPhone IWA J# Java JavaScript JBoss JDBC JOIN JSON JSONGenerator JSONParser Kestrel Label Lambda Large File LDAP Library License LINQ Linux OS Load Balancing Localization Localized PBVM Log In Log Out Logging LONG LONGLONG macOS MAPI Maps MDI Memory Memory Leak Menu Merge MessageBox Messagging Method Migration MIME TYPE Mobile Model ModelStore ModelStore (C#) MSOLEDBSQL Multi Threading MVC MySQL n-Tier Namespace NativePDF NVO OAuth ODATA ODBC Office Offline OLE OLEDB Online Open Source OpenAPI OpenSSL Oracle OrcaScript Other Outlook Output Package Parameter Patch PayPal PB Classic PB Native PB.NET PBC PBD PBDOM PBG PBJVM PBL PBNI PBORCA PBVM PBX PDF Performance Permission PFC Picture Pipeline Play Store (Google) Plugin Popup Port POST PostgreSQL PowerBuilder PowerBuilder (Appeon) PowerBuilder (SAP) PowerBuilder Compiler PowerBuilder Runtime PowerClient PowerScript (PS) PowerScript IDE PowerScript Migrator PowerServer PowerServer Mobile PowerServer Toolkit PowerServer Web PowerServerLabel Print Properties Proxy Publish PULL PUSH Query Regression Release Renew Resize Response REST Retrieve RibbonBar RibbonBar Builder Rich Text Roadmap RPC Runtime Packager SaaS Scaffolding Script SDI SDK Security Server Service Session Single Sign-on Size SMTP SMTPClient SnapDevelop SOAP Sort Source Code Speech Recognition SQL SQL Anywhere SQL Server SqlBuilder SqlExecutor SQLite SqlModelMapper Storage Stored Procedure Subscription SVN Swagger Syntax TabbedBar TabbedView Tablet TabPage Target TE Control Testing Text TFS Theme TIME Timer TLS/SSL Tomcat TortoiseGit TortoiseSVN Transaction Transparency Trial Trigger TRY-CATCH TX Control Type UI ULONG UltraLite Uninstall Unit Test Unit Testing UNIX OS Update Upgrade Upload URL User Center User Object UWP Validation VARCHAR Variable Versioning Visual Studio Visual Studio Code VM Voice Warning WCF Web API Web Extensions Web Service WebBrowser WebForms WebLogic WebSphere WildFly WinAPI Window Windows OS WinForms Wizard Workgroup Workspace WPF XCODE XHTML XML Zoom

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.