注册表操作中,遇到一个奇怪问题,关于打开一个键。
fecat 2005-11-10 10:07:36 char path[200];
lstrcpy(path,"system\\currentcontrolset002\\services\\ccdd");
HKEY hRootKey;
LONG lRet = ::RegOpenKeyEx(HKEY_LOCAL_MACHINE,path,0,KEY_ALL_ACCESS,&hRootKey);
if(lRet==ERROR_SUCCESS)
AfxMessageBox("open the key run success");
else
AfxMessageBox("open the key error!");
以上代码,如果把path指定为system\\currentcontrolset\\services\\ccdd,就没有问题,如果是上面的,就会提示open the key error.
需要说明的是ccdd键我手工创建,肯定存在的。
请问大家是什么原因,会不会是权限问题,如果是权限问题,那么这段代码应该怎么写?