| | |
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
Views: 456 | Replies: 1
| Thread Tools | Search this Thread |
Tag cloud for C++
6 api application array arrays assignment beginner binary bitmap c++ c/c++ calculator char class classes code coding compile compiler console conversion convert count data database delete developer display dll email encryption error file forms fstream function functions game generator getline givemetehcodez graph homeworkhelper iamthwee ifstream image input int java lazy lib loop looping loops map math matrix memory multidimensional multiple newbie news node number output parameter pointer problem program programming project proxy python random read recursion recursive reference return sort sorting string strings struct template templates text tree url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets





