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. Accessing the registry from a dll?

Accessing the registry from a dll?

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++windows-admin
9 Posts 4 Posters 4 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.
  • K Offline
    K Offline
    karmafx
    wrote on last edited by
    #1

    How can I read/write registry entries in an mfc dll? e.g. can I use the CWinApp interface ? Thanks. - KarmaFX

    D L 2 Replies Last reply
    0
    • K karmafx

      How can I read/write registry entries in an mfc dll? e.g. can I use the CWinApp interface ? Thanks. - KarmaFX

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      karmafx wrote: How can I read/write registry entries in an mfc dll? The same way you would in an EXE...with the registry API.


      "Ideas are a dime a dozen. People who put them into action are priceless." - Unknown

      K 1 Reply Last reply
      0
      • D David Crow

        karmafx wrote: How can I read/write registry entries in an mfc dll? The same way you would in an EXE...with the registry API.


        "Ideas are a dime a dozen. People who put them into action are priceless." - Unknown

        K Offline
        K Offline
        karmafx
        wrote on last edited by
        #3

        Thanks.. Okay, so I guess I cannot do it the MFC way ? i.e. CWinApp* pApp = AfxGetApp(); CString key = "Preferences"; CString f = pApp->GetProfileString(key,.... int l = pApp->GetProfileInt(key, .... .... ?????

        D 1 Reply Last reply
        0
        • K karmafx

          Thanks.. Okay, so I guess I cannot do it the MFC way ? i.e. CWinApp* pApp = AfxGetApp(); CString key = "Preferences"; CString f = pApp->GetProfileString(key,.... int l = pApp->GetProfileInt(key, .... .... ?????

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          Sure, you can use the CWinApp() methods, but they are slightly less flexible that the API itself. It really just depends on exactly what you are wanting storing and where.


          "Ideas are a dime a dozen. People who put them into action are priceless." - Unknown

          K 1 Reply Last reply
          0
          • D David Crow

            Sure, you can use the CWinApp() methods, but they are slightly less flexible that the API itself. It really just depends on exactly what you are wanting storing and where.


            "Ideas are a dime a dozen. People who put them into action are priceless." - Unknown

            K Offline
            K Offline
            karmafx
            wrote on last edited by
            #5

            Ok...so now my questions boils down to: How do I get a CWinApp interface within a dll ? in my experience AfxGetApp returns null in dll's... Thanks again. - KarmaFX

            B D 2 Replies Last reply
            0
            • K karmafx

              Ok...so now my questions boils down to: How do I get a CWinApp interface within a dll ? in my experience AfxGetApp returns null in dll's... Thanks again. - KarmaFX

              B Offline
              B Offline
              Blake Miller
              wrote on last edited by
              #6

              There are several decent registry classes here on CodeProject. Why not choose one and use it? Ignore the CWinApp stuff X|

              1 Reply Last reply
              0
              • K karmafx

                Ok...so now my questions boils down to: How do I get a CWinApp interface within a dll ? in my experience AfxGetApp returns null in dll's... Thanks again. - KarmaFX

                D Offline
                D Offline
                David Crow
                wrote on last edited by
                #7

                karmafx wrote: How do I get a CWinApp interface within a dll ? Unless your DLL already uses MFC, you can't.


                "Ideas are a dime a dozen. People who put them into action are priceless." - Unknown

                1 Reply Last reply
                0
                • K karmafx

                  How can I read/write registry entries in an mfc dll? e.g. can I use the CWinApp interface ? Thanks. - KarmaFX

                  L Offline
                  L Offline
                  Larry J Siddens
                  wrote on last edited by
                  #8

                  Take a look at the CRegKey class. Larry J. Siddens

                  K 1 Reply Last reply
                  0
                  • L Larry J Siddens

                    Take a look at the CRegKey class. Larry J. Siddens

                    K Offline
                    K Offline
                    karmafx
                    wrote on last edited by
                    #9

                    Thanks alot ! :-) - KarmaFX

                    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