title: How to check the class id is registered or not?
body: <p>Hi i am checking the GUID of <b>SqlClass which is in my Test.dll</b> But it does not give success it failed with value... Whatis wrong in this code.</p>
  
  <pre><code>#include &lt;windows.h&gt;
  #include &lt;iostream&gt;
  using namespace std; 
  
  int main() {
    HKEY hk;
  
    long n = RegOpenKeyEx(HKEY_CLASSES_ROOT,TEXT("\\CLSID\\SqlClass"),
                    0,KEY_QUERY_VALUE, &amp;hk );"
    if ( n == ERROR_SUCCESS ) {
      cout &lt;&lt; "OK" &lt;&lt; endl;
    }
    else {
      cout &lt;&lt; "Failed with value " &lt;&lt; n &lt;&lt; endl;
    }
  }
  </code></pre>
  
  <p>I tried like this also RegOpenKeyEx(HKEY_CLASSES_ROOT,TEXT("\CLSID\46A951AC-C2D9-48e0-97BE-91F3C9E7B065"),
                        0,KEY_QUERY_VALUE, &amp;hk )</p>
  
  <p><b> THIS CODE WORKS FINE</b></p>
  
  <pre><code>    #include &lt; windows.h &gt;
      # include &lt; iostream &gt;
      using namespace std; 
  
     int main() {
                 HKEY hk;
  
                 long n = RegOpenKeyEx(HKEY_CLASSES_ROOT,
             TEXT("\\CLSID\\{46A951AC-C2D9-48e0-97BE-91F3C9E7B065}"),
                0,KEY_QUERY_VALUE, &amp;hk );"
             if ( n == ERROR_SUCCESS ) {
                 cout &lt;&lt; "OK" &lt;&lt; endl;
               }
              else {
                   cout &lt;&lt; "Failed with value " &lt;&lt; n &lt;&lt; endl;
                  }
           }
  </code></pre>