求教CSDN高手解答。在线等。
在RegQueryValueEx的返回值上应该如何处理?HKEY hKEY; 
LPCTSTR data_Set="Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings";  
long ret0=(::RegOpenKeyEx(HKEY_CURRENT_USER, data_Set, 0, KEY_WRITE,&hKEY)); 
if(ret0!=ERROR_SUCCESS) 

MessageBox("错误: 无法打开有关的hKEY!"); 
return; 
}  int SetContent_D[256];
int SetContent_B[256];
int keyValue = 0;
long ret1;
DWORD dwSize = sizeof(SetContent_B);
SetContent_D[0]=1;
DWORD type_1=REG_DWORD; 
RegQueryValueEx(hKEY,_T("CertificateRevocation"),0,&type_1,(LPBYTE)SetContent_B,&dwSize);//为什么SetContent_B里面的数据都是未初始化的数据呢?
if(1 != SetContent_B[0])
{
 ret1=::RegSetValueEx(hKEY, "CertificateRevocation", NULL, type_1, (const unsigned char *)SetContent_D,4); 
if(ret1!=ERROR_SUCCESS) 
{  
MessageBox("错误: 无法修改有关注册表信息!"); 
return; 

}
microsoftwindows

解决方案 »

  1.   

    为什么SetContent_B[256]获取不到从注册表中读取到的值,我看过注册表那个项CertificateRevocation是存在的,为什么就读不到呢?
      

  2.   

    If the function succeeds, the return value is ERROR_SUCCESS.If the function fails, the return value is a system error code.If the lpData buffer is too small to receive the data, the function returns ERROR_MORE_DATA.If the lpValueName registry value does not exist, the function returns ERROR_FILE_NOT_FOUND.
      

  3.   

    long ret0=(::RegOpenKeyEx(HKEY_CURRENT_USER, data_Set, 0, KEY_READ|KEY_WRITE,&hKEY));
      

  4.   

    if(ERROR_SUCCESS != RegOpenKeyEx(...))
    {
     // Failed
    }