Product Information > Version 7.1 Release Information > Upgrading to JADE Release 7.1 > External Function Calls (PAR 63250)

External Function Calls (PAR 63250)

JADE now publishes external functions declared in the RootSchema jomos external function library that call Windows library functions as defined in the Microsoft Developer Network (MSDN). These external functions are declared to avoid having to declare ANSI‑ and Unicode‑specific definitions for some commonly called Windows library functions; for example, josShellExecute calls ShellExecuteA in an ANSI environment and ShellExecuteW in a Unicode environment.

The following table maps functions defined in the RootSchema jomos external function library to the corresponding MSDN function.

JADE External Function Windows Function Description
josCreateDirectory CreateDirectory Creates a directory that inherits information from other directories (security attributes default to null)
josDeleteDirectory RemoveDirectory Deletes an existing empty directory
josFileAccess GetFileAttributes Retrieves attributes for a specified file or directory (for details, see the paragraph that follows this table)
josFileCopy CopyFile Copies an existing file to a new file
josFileDelete DeleteFile Deletes an existing file
josGetKeyState GetKeyState Retrieves the status of the specified key; that is, whether the key is up, down, or toggled
josGetLastError GetLastError Retrieves the last error code value of the calling thread
josShellExecute ShellExecute Opens or prints the specified file; for example, to start another program under Microsoft Windows

In addition to these functions, the josValidateDirectory external function is declared, which validates that the specified name is a directory. For more details, see Appendix B of the JADE External Interface Developer's Reference.

The Window class now provides the getWindowHandle method, which returns the Windows handle as a MemoryAddress. This method has the following signature.

getWindowHandle(): MemoryAddress;

If a node can execute as a 32‑bit or 64‑bit node, you should use this method rather than the Window class hwnd and getHwnd methods, to ensure that the correct Windows handle is used.

The signature of the josShellExecute method has been changed in JADE 7.1.07. Prior to JADE 7.1.07, the Windows handle parameter was declared as an Integer, and it is now a MemoryAddress. A similar change has been made to the unpublished _getCurrentThread, _getThreadCPUTimes, _shellExecute, and _shellExecuteUnicode methods. All of these functions now use a MemoryAddress rather than an Integer for the Windows handle, to ensure that the correct value is used for the currently executing build type (that is, 32‑bit or 64‑bit). The upgrade process from a JADE 7.0 to a JADE 7.1 release has been changed to include a check for methods that reference these functions. Any such references will result in the method being marked for recompile during the upgrade validation phase. You must correct the references before restarting the validation process.

You must manually check and correct any references in systems that are already running on a JADE 7.1 release.