lpFile 
[in] Pointer to a null-terminated string containing the name of the file in which the specified key and subkeys are saved. If the file already exists, the function fails. 估计文件已存在, 

解决方案 »

  1.   

    同意楼上两位, 多用getlasterror
      

  2.   

    http://www.codeproject.com/tools/JBRegSaveRestore.asp
      

  3.   

    if(rt == ERROR_ALREADY_EXISTS)
        MessageBox(_T("File already exists."), _T("Error"), MB_OK | MB_ICONERROR);
    调试一下看rt是多少,再到MSDN或VC的库里去查是什么错误。
      
    *****************************************************************************
    欢迎使用CSDN论坛专用阅读器 : CSDN Reader(附全部源代码) http://www.cnblogs.com/feiyun0112/archive/2006/09/20/509783.html
      

  4.   

    不要用KEY_ALL_ACCESS, 通常NT/2K/XP操作注册表要有相应权限的,试着合并使用标志.