-
May 16th, 2016, 01:00 AM
#1
Reading registry Win32 SDK
MFC registry functions doesn't work in Win32 SDK DLL. Can someone show me how I can read registry using pure Win32 SDK?
-
May 16th, 2016, 01:32 AM
#2
Re: Reading registry Win32 SDK
-
May 16th, 2016, 02:50 AM
#3
Re: Reading registry Win32 SDK
Originally Posted by maverick786us
MFC registry functions doesn't work in Win32 SDK DLL. Can someone show me how I can read registry using pure Win32 SDK?
Not sure what you meant by "MFC registry functions", but agree, that can work only with MFC dll.
Registry Functions
32-bit and 64-bit Application Data in the Registry
Victor Nijegorodov
-
May 18th, 2016, 04:27 AM
#4
Re: Reading registry Win32 SDK
- "Pure" raw Windows API registry functions are located in Advapi32.dll, according to MSDN documentation.
- For keeping MFC application settings under HKEY_CURRENT_USER, you can use CWinApp methods like CWinApp::GetProfileString, CWinApp::WriteProfileString, etc.
- For dealing with HKEY_LOCAL_MACHINE or other registry sections, you can use CRegKey which is an ATL class but can be used in MFC applications, as well.
- Once you are using MFC and/or ATL, it has no much sense to reinvent the wheel by directly using of "pure" raw Windows API functions (except where is absolutelly necessary).
- Last but not the least: both MFC and ATL methods ar "pure" as well, as long as they are using "pure" Windows API stuff behind.
-
May 18th, 2016, 11:14 AM
#5
Re: Reading registry Win32 SDK
One thing that used to be cool about the ATL CRegKey class was that it was a templated class and it didn't require any dependency dll (similar to std::string).
Not sure if this is still true or not. The msdn docs list atlbase.h as a requirement but no library to link to. That tells me it can operate standalone without any MFC or ATL runtime dependencies.
I'd try it.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|