VC获取操作系统位数
方法1,msdn 有相应的例子,代码贴出来给你看看
MSDN有相应Example!
#include <windows.h>
typedef BOOL (WINAPI *LPFN_ISWOW64PROCESS) (HANDLE, PBOOL);
LPFN_ISWOW64PROCESS
fnIsWow64Process = (LPFN_ISWOW64PROCESS)GetProcAddress(
GetModuleHandle( "kernel32 "), "IsWow64Process ");
BOOL IsWow64()
{
BOOL bIsWow64 = FALSE;
if (NULL != fnIsWow64Process)
{
if (!fnIsWow64Process(GetCurrentProcess(),&bIsWow64))
{// handle error
std::cout < < "Handle Error " < <std::endl;
}
}
return bIsWow64;
}
方法2:
GetSystemWow64Directory
判断这个文件夹是否存在