There is no direct way to programmatically determine if an OpenEdge session is a 32-bit or 64-bit process in OE versions prior to 11.3, when the PROCESS-ARCHITECTURE function was introduced.
This limitation can potentially be worked around if a naming convention exists for OpenEdge installation directories (DLC) that identifies 32-bit vs. 64-bit installations. For example:
- If installation directories are named to indicate what version of OpenEdge is installed in them, including the bitness, the bitness can be parsed from the directory name. For example, the DLC might be /usr/DLC102b_64 on a Unix machine or C:\Progress\OpenEdge102b_32 on a Windows machine. If this condition is met, code like the following can determine which version is running:
cVersion = OS-GETENV('DLC').
IF OPSYS = 'WIN32'
THEN DO:
IF INDEX('32',cVersion) > 0
THEN hCallObject:LIBRARY = 'my32BitWinLibrary.dll'.
ELSE IF INDEX('64',cVersion)
THEN hCallObject:LIBRARY = 'my64BitWinLibrary.dll'.
ELSE MESSAGE 'no such bitness' VIEW-AS ALERT-BOX.
END. /* Windows' */
ELSE IF OPSYS = 'UNIX'
THEN DO:
IF INDEX('32',cVersion) > 0
THEN hCallObject:LIBRARY = 'my32BitUnixLibrary.so'.
ELSE IF INDEX('64',cVersion)
THEN hCallObject:LIBRARY = 'my64BitUnixLibrary.so'.
ELSE MESSAGE 'no such bitness' VIEW-AS ALERT-BOX.
END. /* Unix */
ELSE MESSAGE 'no such operating system' VIEW-AS ALERT-BOX.
- If the names of the installation directories do not follow a pattern, but they are known in advance and are not reused on different machines, they could be stored them in a database table along with their bitness and the bitness retrieved at run time. For example:
cVersion = OS-GETENV('DLC').
FIND FIRST LibraryTable WHERE Dlc = cVersion.
hCallObject:LIBRARY = LibraryTable.Library.
- Run <install-dir>/bin/showcfg from the command prompt or double-click the <install-dir>\progress.cfg file in Windows. Match the port number shown in the config file viewer with the os-bitness using one of the below articles: