A wxWidgets function used to determine the registry key value

Source: Internet
Author: User
Tags wxwidgets

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.