Skip to content
This repository has been archived by the owner on Dec 2, 2024. It is now read-only.

Commit

Permalink
Add RegistryInterface include directories, update main.cpp to use Reg…
Browse files Browse the repository at this point in the history
…istryInterface instead of RegistryHelper.

- Updated project files to include ../RegistryInterface in AdditionalIncludeDirectories.
- Modified main.cpp to use RegistryInterface instead of RegistryHelper for registry operations.
  • Loading branch information
Arteiii committed Feb 19, 2024
1 parent 2599ee8 commit ce287e9
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 8 deletions.
6 changes: 4 additions & 2 deletions Example/Example.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<AdditionalIncludeDirectories>../RegistryInterface</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
Expand All @@ -106,6 +107,7 @@
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<AdditionalIncludeDirectories>../RegistryInterface</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
Expand All @@ -120,7 +122,7 @@
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>..\RegistryHelper;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>../RegistryInterface</AdditionalIncludeDirectories>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
</ClCompile>
Expand All @@ -137,7 +139,7 @@
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>..\RegistryHelper;</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>../RegistryInterface</AdditionalIncludeDirectories>
<LanguageStandard>stdcpplatest</LanguageStandard>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
Expand Down
8 changes: 5 additions & 3 deletions Example/main.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#include "pch.h"

#include "../RegistryHelper.h"
#include "RegistryInterface.h"

int
main()
{
try {
RegistryHelper registryHelper;
RegistryInterface registryInterface;
std::wstring subKey = L"SYSTEM\\CurrentControlSet\\Control";
HKEY hKey = HKEY_LOCAL_MACHINE;

Expand Down Expand Up @@ -59,8 +60,9 @@ main()

std::wcout << L"Values: " << std::endl;
for (const auto& valuePair : values) {
std::wcout << L" " << valuePair.first << L" (Type: " << valuePair.second
<< L")" << std::endl;
std::wcout << L" " << valuePair.first << L" (Type: "
<< registryInterface.GetDataTypeName(valuePair.second) << L")"
<< std::endl;
}
} catch (const RegistryError& ex) {
std::cerr << "Registry Error: " << ex.what()
Expand Down
1 change: 1 addition & 0 deletions Example/pch.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

// add headers that you want to pre-compile here

#include "../RegistryHelper.h"
#include <iostream>

#endif // PCH_H
5 changes: 4 additions & 1 deletion RegistryHelper.sln
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{3587BC45-E1D1-4FCE-9F36-D4BD660FB262}"
ProjectSection(SolutionItems) = preProject
.clang-format = .clang-format
.gitignore = .gitignore
RegistryHelper.h = RegistryHelper.h
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Example", "Example\Example.vcxproj", "{FD807556-B9F5-4D19-814A-FE0F51F514E1}"
ProjectSection(ProjectDependencies) = postProject
{40299226-5106-4793-A43D-9BBB17111B64} = {40299226-5106-4793-A43D-9BBB17111B64}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RegistryInterface", "RegistryInterface\RegistryInterface.vcxproj", "{40299226-5106-4793-A43D-9BBB17111B64}"
EndProject
Expand All @@ -22,6 +24,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Workflows", "Workflows", "{
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Repository", "Repository", "{1FF7BFD7-87F0-4612-8468-FB56B6A0DAF0}"
ProjectSection(SolutionItems) = preProject
.gitignore = .gitignore
LICENSE.md = LICENSE.md
README.md = README.md
EndProjectSection
Expand Down
2 changes: 1 addition & 1 deletion RegistryInterface/RegistryInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ struct ServiceInfo
class RegistryInterface
{
public:
RegistryInterface();
// RegistryInterface(); not implemented

// Methods related to service information
std::vector<ServiceInfo> EnumerateServices();
Expand Down
1 change: 0 additions & 1 deletion RegistryInterface/framework.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers

#include "../RegistryHelper.h"

#include <iostream>
#include <unordered_map>

0 comments on commit ce287e9

Please sign in to comment.