GetNativeSystemInfo(lpSystemInfo); if(lpSystemInfo->wProcessorArchitecture==PROCESSOR_ARCHITECTURE_UNKNOWN) MessageBox("无法获得当前版本信息"); if(lpSystemInfo->wProcessorArchitecture==PROCESSOR_ARCHITECTURE_INTEL) MessageBox("Windows Me/98/95"); if(lpSystemInfo->wProcessorArchitecture==PROCESSOR_ARCHITECTURE_MIPS) MessageBox("Windows NT 3.51"); if(lpSystemInfo->wProcessorArchitecture==PROCESSOR_ARCHITECTURE_ALPHA) MessageBox("Windows NT 4.0 and earlier ALPHA"); if(lpSystemInfo->wProcessorArchitecture==PROCESSOR_ARCHITECTURE_PPC) MessageBox("Windows NT 4.0 and earlier PPC"); if(lpSystemInfo->wProcessorArchitecture==PROCESSOR_ARCHITECTURE_IA64) MessageBox("64-bit Windows IA64"); if(lpSystemInfo->wProcessorArchitecture==PROCESSOR_ARCHITECTURE_IA32_ON_WIN64) MessageBox("64-bit Windows IA32_ON_WIN64"); if(lpSystemInfo->wProcessorArchitecture==PROCESSOR_ARCHITECTURE_AMD64) MessageBox("64-bit Windows AMD64"); delete lpSystemInfo 无论如何都是MessageBox("Windows Me/98/95")他的值好像是0.换到其他系统运行也是一样
GetNativeSystemInfo()根据返回的stSystemInfo.wProcessorArchitecture;
http://www.codeproject.com/KB/system/camel.aspx
#define PROCESSOR_ARCHITECTURE_AMD64 9
GetNativeSystemInfo(lpSystemInfo);
if(lpSystemInfo->wProcessorArchitecture==PROCESSOR_ARCHITECTURE_UNKNOWN)
MessageBox("无法获得当前版本信息");
if(lpSystemInfo->wProcessorArchitecture==PROCESSOR_ARCHITECTURE_INTEL)
MessageBox("Windows Me/98/95");
if(lpSystemInfo->wProcessorArchitecture==PROCESSOR_ARCHITECTURE_MIPS)
MessageBox("Windows NT 3.51");
if(lpSystemInfo->wProcessorArchitecture==PROCESSOR_ARCHITECTURE_ALPHA)
MessageBox("Windows NT 4.0 and earlier ALPHA");
if(lpSystemInfo->wProcessorArchitecture==PROCESSOR_ARCHITECTURE_PPC)
MessageBox("Windows NT 4.0 and earlier PPC");
if(lpSystemInfo->wProcessorArchitecture==PROCESSOR_ARCHITECTURE_IA64)
MessageBox("64-bit Windows IA64");
if(lpSystemInfo->wProcessorArchitecture==PROCESSOR_ARCHITECTURE_IA32_ON_WIN64)
MessageBox("64-bit Windows IA32_ON_WIN64");
if(lpSystemInfo->wProcessorArchitecture==PROCESSOR_ARCHITECTURE_AMD64)
MessageBox("64-bit Windows AMD64");
delete lpSystemInfo
无论如何都是MessageBox("Windows Me/98/95")他的值好像是0.换到其他系统运行也是一样
int b=sizeof(a);
判断b是4 或者8 是否可行?