各位高手帮我看看这段程序为什么不行,
void CItemDlg::OnButton1() {
// TODO: Add your control notification handler code here
HKEY key;
LPCTSTR path="HARDWARE\\SYSTEM\\";
RegOpenKeyEx(HKEY_LOCAL_MACHINE,path,0,KEY_READ,&key);
DWORD x;
CHAR achValue[256];
DWORD cchValue =256;
for(x=0;x<4;x++)
{
RegEnumKeyEx(key,x,achValue,&cchValue, NULL, NULL, NULL, NULL);
CString out=CString(achValue);
MessageBox(out);
memset(achValue,0,255);
}
RegCloseKey(key);
}
//为什么运行后有时得到的只有几个字母?请问各位高手应该怎样解决