Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Registry backup/restore

Registry backup/restore

Scheduled Pinned Locked Moved C / C++ / MFC
windows-adminquestion
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    esapp420
    wrote on last edited by
    #1

    I would like to write a routine to copy registry entries into an INI file then back into the registry, but the only functions I can find in CWinApp are WriteProfile and GetProfile. Does anybody know if there is anything built-in for this task or if it must be done manually?? Any suggestions are appriciated. Thanks! Is it football season yet... GO GATORS!!!

    R 1 Reply Last reply
    0
    • E esapp420

      I would like to write a routine to copy registry entries into an INI file then back into the registry, but the only functions I can find in CWinApp are WriteProfile and GetProfile. Does anybody know if there is anything built-in for this task or if it must be done manually?? Any suggestions are appriciated. Thanks! Is it football season yet... GO GATORS!!!

      R Offline
      R Offline
      Roman Fadeyev
      wrote on last edited by
      #2

      unfortunately, there is no any appropriate functions in MFC for your task. Moreover, MFC does not include any routines for INI-support (as far as i know). You must do it manually, by WinAPI functions. See in MSDN: RegOpenKey[Ex], RegCloseKey and so on for Registry operation AND GetProfileInt, GetProfileSection, GetProfileString etc. for INI-operations

      E 1 Reply Last reply
      0
      • R Roman Fadeyev

        unfortunately, there is no any appropriate functions in MFC for your task. Moreover, MFC does not include any routines for INI-support (as far as i know). You must do it manually, by WinAPI functions. See in MSDN: RegOpenKey[Ex], RegCloseKey and so on for Registry operation AND GetProfileInt, GetProfileSection, GetProfileString etc. for INI-operations

        E Offline
        E Offline
        esapp420
        wrote on last edited by
        #3

        I was afraid of that. Oh well, doesnt seem all that difficult to do manually so thats what ill do! Thanks.

        R 1 Reply Last reply
        0
        • E esapp420

          I was afraid of that. Oh well, doesnt seem all that difficult to do manually so thats what ill do! Thanks.

          R Offline
          R Offline
          Roman Fadeyev
          wrote on last edited by
          #4

          There is an another way to solve your problem. You may use regedit with command-line params for saving and loading your data from reg-file. Like that regedit /e My.reg HKEY_CURRENT_USER\Software\My Data //From registry to file regedit -s My.reg //From file to registry You can use WINAPI - CreateProcess function to make this job silent

          E 1 Reply Last reply
          0
          • R Roman Fadeyev

            There is an another way to solve your problem. You may use regedit with command-line params for saving and loading your data from reg-file. Like that regedit /e My.reg HKEY_CURRENT_USER\Software\My Data //From registry to file regedit -s My.reg //From file to registry You can use WINAPI - CreateProcess function to make this job silent

            E Offline
            E Offline
            esapp420
            wrote on last edited by
            #5

            This is exactly what I was looking for! Thanks!

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups