Accessing the registry from a dll?
-
How can I read/write registry entries in an mfc dll? e.g. can I use the CWinApp interface ? Thanks. - KarmaFX
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
-
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
-
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, .... .... ?????
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
-
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
-
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
There are several decent registry classes here on CodeProject. Why not choose one and use it? Ignore the CWinApp stuff X|
-
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
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
-
How can I read/write registry entries in an mfc dll? e.g. can I use the CWinApp interface ? Thanks. - KarmaFX
Take a look at the CRegKey class. Larry J. Siddens
-
Take a look at the CRegKey class. Larry J. Siddens