答案 0 :(得分:0)
使用此课程无法做到这一点。
如何使其正常工作
long lError = RegOpenKeyEx(HKEY_LOCAL_MACHINE,
"HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0",
0,
KEY_READ,
&hKey);
if(lError != ERROR_SUCCESS)
{// if the key is not found, tell the user why:
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM,
NULL,
lError,
0,
Buffer,
_MAX_PATH,
0);
AfxMessageBox(Buffer);
return "N/A";
}
// query the key:
RegQueryValueEx(hKey, "~MHz", NULL, NULL, (LPBYTE) &dwMHz, &BufSize);
// convert the DWORD to a CString:
sMHz.Format("%i", dwMHz);
返回sMHz;