在PowerBuilder中确定操作系统类型.

Sid*_*Sid 0 powerbuilder

如何在PowerBuilder中确定操作系统是64位还是32位?

是否可以使用GetEnvironment获取它?

Rea*_*wTo 8

检查环境变量很容易,但它不是防弹,因为用户可以重新定义该值.

更强大的方法是检查当前的Powerbuilder进程是否在WOW64模式(32位仿真模式)下运行.

[Local external definitions]
FUNCTION long IsWow64Process(long hwnd, ref  boolean Wow64Process) &
    LIBRARY "Kernel32.DLL"

FUNCTION long GetCurrentProcess ()  LIBRARY "KERNEL32.DLL"

[Powerscript]
boolean wow64 =false
IsWow64Process(GetCurrentProcess(), wow64)
MessageBox("Running in 64b env", wow64)
Run Code Online (Sandbox Code Playgroud)