| | |
Does this SubKey Exist ?
Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: Oct 2008
Posts: 122
Reputation:
Solved Threads: 6
How would it be possible to check if a subKey exist in the Classes root in Registry Editor. My attemt is like follows but my compiler doesn´t like it.
'Microsoft::Win32::RegistryKey' : class does not have a copy-constructor
no conversion from 'nullptr' to 'Microsoft::Win32::RegistryKey'
'Microsoft::Win32::RegistryKey' : class does not have a copy-constructor
no conversion from 'nullptr' to 'Microsoft::Win32::RegistryKey'
C++ Syntax (Toggle Plain Text)
Microsoft::Win32::RegistryKey subKey1 = Microsoft::Win32::Registry::ClassesRoot->OpenSubKey("one\\two"); if( subKey1 != nullptr ) //Exists ? { //do something }
•
•
Join Date: Oct 2008
Posts: 122
Reputation:
Solved Threads: 6
This is working, found a solution.
C++ Syntax (Toggle Plain Text)
RegistryKey^ rk; rk = Registry::ClassesRoot->OpenSubKey("abc1\\asd123", true); if (rk == nullptr)//key exist { //Do Not Exists !!! } if (rk != nullptr) //key doesn't exist { //Do Exists !!! }
•
•
•
•
How would it be possible to check if a subKey exist in the Classes root in Registry Editor. My attemt is like follows but my compiler doesn´t like it.
'Microsoft::Win32::RegistryKey' : class does not have a copy-constructor
no conversion from 'nullptr' to 'Microsoft::Win32::RegistryKey'
C++ Syntax (Toggle Plain Text)
Microsoft::Win32::RegistryKey subKey1 = Microsoft::Win32::Registry::ClassesRoot->OpenSubKey("one\\two"); if( subKey1 != nullptr ) //Exists ? { //do something }
![]() |
Similar Threads
- Help and support and Msconfig won't open, Search disabled (Windows NT / 2000 / XP)
- Outlook Express Won't Start (msimn.exe goes to 98% cpu usage) (Windows Software)
- Help regarding writing to local registry (C#)
- Winlogon.exe infected or not? (Viruses, Spyware and other Nasties)
- Nasty-*** virus (Viruses, Spyware and other Nasties)
- I've got Trojan.Holax... is this bad? (Viruses, Spyware and other Nasties)
- not-a-virusadware (Viruses, Spyware and other Nasties)
Other Threads in the C++ Forum
- Previous Thread: C++ funtions calling other functions
- Next Thread: c++ runtime
| Thread Tools | Search this Thread |
api array arrays based beginner binary bitmap c++ c/c++ calculator char char* class code coding compile compiler console conversion count data database delete deploy developer dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game getline givemetehcodez graph gui homeworkhelp homeworkhelper iamthwee ifstream input int java lib linker list loop looping loops map math matrix memory multiple news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference rpg sorting string strings temperature template test text text-file tree url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets





