RegRestoreKey() Problem
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: RegRestoreKey() Problem

  1. #1
    Join Date
    Jul 2009
    Location
    India
    Posts
    835

    RegRestoreKey() Problem

    Im having problem with RegRestoreKey() function. I have previously saved some reg key with RegSaveKey(). Now while Im trying to restore those .dat files using RegRestoreKey() function is not being done..

    Both SE_BACKUP_NAME and SE_RESTORE_NAME privilege has already set. what could be the possible reasons ??..

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Wallisellen (ZH), Switzerland
    Posts
    17,276

    Re: RegRestoreKey() Problem

    What did RegSaveKey return?
    What does RegRestoreKey return?
    Victor Nijegorodov

  3. #3
    Join Date
    Jul 2009
    Location
    India
    Posts
    835

    Re: RegRestoreKey() Problem

    RegSaveKey is fine.. No issue with that.. cause I can see the file placed in my hdd.. and about RegRestoreKey. It's not returning ERROR_SUCCESS what it should be if its succeed.. and if i check with GetLastError with FormatMessage its saying "The operation complete successfully"...

  4. #4
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Wallisellen (ZH), Switzerland
    Posts
    17,276

    Re: RegRestoreKey() Problem

    Registry APIs do NOT SetLastError (it is the reason you get "no error..." from SetLastError), instead they directly return you the error code!
    Victor Nijegorodov

  5. #5
    Join Date
    Jul 2009
    Location
    India
    Posts
    835

    Re: RegRestoreKey() Problem

    Ok.. Its done now.. RegRestoreKey could not able to overwrite the keys.. I need to delete the key and then restore it.. Now there is no problem.. Anyways.. Thanks VictorN for your support.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center