The project needs to use wxWidgets to read the key value of the registry. When you use the QueryValue method of wxRegKey to read the corresponding key value, for example, the following code. If the regdelay key does not exist, an exception is thrown. So the user experience is poor. 650) this. width = 650; ". click = 'window. open (" http://blog.51cto.com/viewpic.php? Refimg = "+ this. src) '. click =" window. open ("http://blog.51cto.com/viewpic.php? Refimg = "+ this. src) "src =" http://www.bkjia.com/uploads/allimg/131228/1ZH910V-0.gif "align =" top "/> pRegKey-> QueryValue (wxT (" regdelay "), keyvaluestr); check the manual, at first, we found that a function is used to return the existence of a Boolean value for the key value. However, it is unstable in actual use and often cannot return the correct value.650) this. width = 650; ". click = 'window. open (" http://blog.51cto.com/viewpic.php? Refimg = "+ this. src) '. click =" window. open ("http://blog.51cto.com/viewpic.php? Refimg = "+ this. src)" src = "http://www.bkjia.com/uploads/allimg/131228/1ZH910V-0.gif" align = "top"/> bool HasSubKey (const wxChar * szKey) const
I don't know whether it is my own problem or the wxWidgets library bug. The progress was too tight, so I carefully studied the wxRegKey document and wrote a function to check whether a key value exists. The test result is still stable. Code: 650) this. width = 650; ". click = 'window. open (" http://blog.51cto.com/viewpic.php? Refimg = "+ this. src) '. click =" window. open ("http://blog.51cto.com/viewpic.php? Refimg = "+ this. src)" src = "http://www.bkjia.com/uploads/allimg/131228/1ZH910V-0.gif" align = "top"/> bool VerifyEnCrptyFunction: RegKeyHasValue (wxString regkey, wxString key)
650) this. width = 650; ". click = 'window. open (" http://blog.51cto.com/viewpic.php? Refimg = "+ this. src) '. click =" window. open ("http://blog.51cto.com/viewpic.php? Refimg = "+ this. src)" src = "http://www.bkjia.com/uploads/allimg/131228/1ZH910V-0.gif" align = "top"/> {
650) this. width = 650; ". click = 'window. open (" http://blog.51cto.com/viewpic.php? Refimg = "+ this. src) '. click =" window. open ("http://blog.51cto.com/viewpic.php? Refimg = "+ this. src)" src = "http://www.bkjia.com/uploads/allimg/131228/1ZH910V-0.gif" align = "top"/> wxRegKey pRegKey (pregkey );
650) this. width = 650; ". click = 'window. open (" http://blog.51cto.com/viewpic.php? Refimg = "+ this. src) '. click =" window. open ("http://blog.51cto.com/viewpic.php? Refimg = "+ this. src)" src = "http://www.bkjia.com/uploads/allimg/131228/1ZH910V-0.gif" align = "top"/> if (pRegKey-> Exists ())
650) this. width = 650; ". click = 'window. open (" http://blog.51cto.com/viewpic.php? Refimg = "+ this. src) '. click =" window. open ("http://blog.51cto.com/viewpic.php? Refimg = "+ this. src)" src = "http://www.bkjia.com/uploads/allimg/131228/1ZH910V-0.gif" align = "top"/> {
650) this. width = 650; ". click = 'window. open (" http://blog.51cto.com/viewpic.php? Refimg = "+ this. src) '. click =" window. open ("http://blog.51cto.com/viewpic.php? Refimg = "+ this. src)" src = "http://www.bkjia.com/uploads/allimg/131228/1ZH910V-0.gif" align = "top"/> if (pRegKey-> Open ())
650) this. width = 650; ". click = 'window. open (" http://blog.51cto.com/viewpic.php? Refimg = "+ this. src) '. click =" window. open ("http://blog.51cto.com/viewpic.php? Refimg = "+ this. src)" src = "http://www.bkjia.com/uploads/allimg/131228/1ZH910V-0.gif" align = "top"/> {
650) this. width = 650; ". click = 'window. open (" http://blog.51cto.com/viewpic.php? Refimg = "+ this. src) '. click =" window. open ("http://blog.51cto.com/viewpic.php? Refimg = "+ this. src)" src = "http://www.bkjia.com/uploads/allimg/131228/1ZH910V-0.gif" align = "top"/> if (pRegKey-> HasValue (key ))
650) this. width = 650; ". click = 'window. open (" http://blog.51cto.com/viewpic.php? Refimg = "+ this. src) '. click =" window. open ("http://blog.51cto.com/viewpic.php? Refimg = "+ this. src)" src = "http://www.bkjia.com/uploads/allimg/131228/1ZH910V-0.gif" align = "top"/> {
650) this. width = 650; ". click = 'window. open (" http://blog.51cto.com/viewpic.php? Refimg = "+ this. src) '. click =" window. open ("http://blog.51cto.com/viewpic.php? Refimg = "+ this. src)" src = "http://www.bkjia.com/uploads/allimg/131228/1ZH910V-0.gif" align = "top"/> return true;
650) this. width = 650; ". click = 'window. open (" http://blog.51cto.com/viewpic.php? Refimg = "+ this. src) '. click =" window. open ("http://blog.51cto.com/viewpic.php? Refimg = "+ this. src)" src = "http://www.bkjia.com/uploads/allimg/131228/1ZH910V-0.gif" align = "top"/>}
650) this. width = 650; ". click = 'window. open (" http://blog.51cto.com/viewpic.php? Refimg = "+ this. src) '. click =" window. open ("http://blog.51cto.com/viewpic.php? Refimg = "+ this. src)" src = "http://www.bkjia.com/uploads/allimg/131228/1ZH910V-0.gif" align = "top"/> else
650) this. width = 650; ". click = 'window. open (" http://blog.51cto.com/viewpic.php? Refimg = "+ this. src) '. click =" window. open ("http://blog.51cto.com/viewpic.php? Refimg = "+ this. src)" src = "http://www.bkjia.com/uploads/allimg/131228/1ZH910V-0.gif" align = "top"/> {
650) this. width = 650; ". click = 'window. open (" http://blog.51cto.com/viewpic.php? Refimg = "+ this. src) '. click =" window. open ("http://blog.51cto.com/viewpic.php? Refimg = "+ this. src)" src = "http://www.bkjia.com/uploads/allimg/131228/1ZH910V-0.gif" align = "top"/> return false;
650) this. width = 650; ". click = 'window. open (" http://blog.51cto.com/viewpic.php? Refimg = "+ this. src) '. click =" window. open ("http://blog.51cto.com/viewpic.php? Refimg = "+ this. src)" src = "http://www.bkjia.com/uploads/allimg/131228/1ZH910V-0.gif" align = "top"/>}
650) this. width = 650; ". click = 'window. open (" http://blog.51cto.com/viewpic.php? Refimg = "+ this. src) '. click =" window. open ("http://blog.51cto.com/viewpic.php? Refimg = "+ this. src)" src = "http://www.bkjia.com/uploads/allimg/131228/1ZH910V-0.gif" align = "top"/>}
650) this. width = 650; ". click = 'window. open (" http://blog.51cto.com/viewpic.php? Refimg = "+ this. src) '. click =" window. open ("http://blog.51cto.com/viewpic.php? Refimg = "+ this. src)" src = "http://www.bkjia.com/uploads/allimg/131228/1ZH910V-0.gif" align = "top"/>}
650) this. width = 650; ". click = 'window. open (" http://blog.51cto.com/viewpic.php? Refimg = "+ this. src) '. click =" window. open ("http://blog.51cto.com/viewpic.php? Refimg = "+ this. src)" src = "http://www.bkjia.com/uploads/allimg/131228/1ZH910V-0.gif" align = "top"/> return false;
650) this. width = 650; ". click = 'window. open (" http://blog.51cto.com/viewpic.php? Refimg = "+ this. src) '. click =" window. open ("http://blog.51cto.com/viewpic.php? Refimg = "+ this. src) "src =" http://www.bkjia.com/uploads/allimg/131228/1ZH910V-0.gif "align =" top "/>} usage: 650) this. width = 650 ;". click = 'window. open ("http://blog.51cto.com/viewpic.php? Refimg = "+ this. src) '. click =" window. open ("http://blog.51cto.com/viewpic.php? Refimg = "+ this. src)" src = "http://www.bkjia.com/uploads/allimg/131228/1ZH910V-0.gif" align = "top"/> // The user saves the key value
650) this. width = 650; ". click = 'window. open (" http://blog.51cto.com/viewpic.php? Refimg = "+ this. src) '. click =" window. open ("http://blog.51cto.com/viewpic.php? Refimg = "+ this. src)" src = "http://www.bkjia.com/uploads/allimg/131228/1ZH910V-0.gif" align = "top"/> wxString keyvaluestr;
650) this. width = 650; ". click = 'window. open (" http://blog.51cto.com/viewpic.php? Refimg = "+ this. src) '. click =" window. open ("http://blog.51cto.com/viewpic.php? Refimg = "+ this. src)" src = "http://www.bkjia.com/uploads/allimg/131228/1ZH910V-0.gif" align = "top"/> // construct a Registry Key Path
650) this. width = 650; ". click = 'window. open (" http://blog.51cto.com/viewpic.php? Refimg = "+ this. src) '. click =" window. open ("http://blog.51cto.com/viewpic.php? Refimg = "+ this. src)" src = "http://www.bkjia.com/uploads/allimg/131228/1ZH910V-0.gif" align = "top"/> wxString regkey = wxT ("HKEY_LOCAL_MACHINE \ Software \ iLcd ");
650) this. width = 650; ". click = 'window. open (" http://blog.51cto.com/viewpic.php? Refimg = "+ this. src) '. click =" window. open ("http://blog.51cto.com/viewpic.php? Refimg = "+ this. src)" src = "http://www.bkjia.com/uploads/allimg/131228/1ZH910V-0.gif" align = "top"/> if (RegKeyHasValue (regkey, wxT ("regdelay ")))
650) this. width = 650; ". click = 'window. open (" http://blog.51cto.com/viewpic.php? Refimg = "+ this. src) '. click =" window. open ("http://blog.51cto.com/viewpic.php? Refimg = "+ this. src)" src = "http://www.bkjia.com/uploads/allimg/131228/1ZH910V-0.gif" align = "top"/> {
650) this. width = 650; ". click = 'window. open (" http://blog.51cto.com/viewpic.php? Refimg = "+ this. src) '. click =" window. open ("http://blog.51cto.com/viewpic.php? Refimg = "+ this. src)" src = "http://www.bkjia.com/uploads/allimg/131228/1ZH910V-0.gif" align = "top"/> // you have regdelay to query the content under this key value
650) this. width = 650; ". click = 'window. open (" http://blog.51cto.com/viewpic.php? Refimg = "+ this. src) '. click =" window. open ("http://blog.51cto.com/viewpic.php? Refimg = "+ this. src)" src = "http://www.bkjia.com/uploads/allimg/131228/1ZH910V-0.gif" align = "top"/> pRegKey-> QueryValue (wxT ("regdelay"), keyvaluestr );
650) this. width = 650; ". click = 'window. open (" http://blog.51cto.com/viewpic.php? Refimg = "+ this. src) '. click =" window. open ("http://blog.51cto.com/viewpic.php? Refimg = "+ this. src)" src = "http://www.bkjia.com/uploads/allimg/131228/1ZH910V-0.gif" align = "top"/>}
650) this. width = 650; ". click = 'window. open (" http://blog.51cto.com/viewpic.php? Refimg = "+ this. src) '. click =" window. open ("http://blog.51cto.com/viewpic.php? Refimg = "+ this. src)" src = "http://www.bkjia.com/uploads/allimg/131228/1ZH910V-0.gif" align = "top"/> else
650) this. width = 650; ". click = 'window. open (" http://blog.51cto.com/viewpic.php? Refimg = "+ this. src) '. click =" window. open ("http://blog.51cto.com/viewpic.php? Refimg = "+ this. src)" src = "http://www.bkjia.com/uploads/allimg/131228/1ZH910V-0.gif" align = "top"/> {
650) this. width = 650; ". click = 'window. open (" http://blog.51cto.com/viewpic.php? Refimg = "+ this. src) '. click =" window. open ("http://blog.51cto.com/viewpic.php? Refimg = "+ this. src)" src = "http://www.bkjia.com/uploads/allimg/131228/1ZH910V-0.gif" align = "top"/> // no regdelay returns no value
650) this. width = 650; ". click = 'window. open (" http://blog.51cto.com/viewpic.php? Refimg = "+ this. src) '. click =" window. open ("http://blog.51cto.com/viewpic.php? Refimg = "+ this. src)" src = "http://www.bkjia.com/uploads/allimg/131228/1ZH910V-0.gif" align = "top"/> keyvaluestr = wxT ("no value ");
650) this. width = 650; ". click = 'window. open (" http://blog.51cto.com/viewpic.php? Refimg = "+ this. src) '. click =" window. open ("http://blog.51cto.com/viewpic.php? Refimg = "+ this. src)" src = "http://www.bkjia.com/uploads/allimg/131228/1ZH910V-0.gif" align = "top"/>}
This article is from the "Jiu Li tribe" blog, please be sure to keep this source http://axiii.blog.51cto.com/396236/126673