CRegKey keyRoot;
CString straaa;
LONG lRes = keyRoot.Open(HKEY_LOCAL_MACHINE, _T("SYSTEM\\CurrentControlSet\\Services\\MyService\\Security\\Policy"), KEY_ALL_ACCESS);
if (lRes != ERROR_SUCCESS)
return ""; DWORD dwRet;
dwRet = 512;
AfxMessageBox("222");
lRes = keyRoot.QueryValue((char *)(LPCTSTR)straaa,NULL,&dwRet);
AfxMessageBox("333");
if (lRes != ERROR_SUCCESS)
return ""; keyRoot.Close();执行时, 在2000/xp sp2上正常,但在xp sp1下出现错误aaa.exe文件遇到问题需要关闭, 对引起的不便表示抱歉。why?
我试了2台都是这个问题,在queryvalue处出错。
CString straaa;
LONG lRes = keyRoot.Open(HKEY_LOCAL_MACHINE, _T("SYSTEM\\CurrentControlSet\\Services\\MyService\\Security\\Policy"), KEY_ALL_ACCESS);
if (lRes != ERROR_SUCCESS)
return ""; DWORD dwRet;
dwRet = 512;
AfxMessageBox("222");
lRes = keyRoot.QueryValue((char *)(LPCTSTR)straaa,NULL,&dwRet);
AfxMessageBox("333");
if (lRes != ERROR_SUCCESS)
return ""; keyRoot.Close();执行时, 在2000/xp sp2上正常,但在xp sp1下出现错误aaa.exe文件遇到问题需要关闭, 对引起的不便表示抱歉。why?
我试了2台都是这个问题,在queryvalue处出错。
char buf[255];
lResult =keyRoot.QueryValue(buf,"keyname",&dwLen);