title: Getting CPU ID code from C# to be in C++
body: <p>I have this C# code to get Processor ID but I'm not able to pass it to C++, I tried a lot but I really can't, I just started in C++ and I would like to be able to get the CPU ID with C++ like I used to get with C#</p>
  
  <p>This is the code I have in C#:</p>
  
  <pre><code>public static string GetProcessorID()
  {
    string sProcessorID = "";
    string sQuery = "SELECT ProcessorId FROM Win32_Processor";
    ManagementObjectSearcher oManagementObjectSearcher = new ManagementObjectSearcher(sQuery);
    ManagementObjectCollection oCollection = oManagementObjectSearcher.Get();
    foreach (ManagementObject oManagementObject in oCollection)
    {
      sProcessorID = (string)oManagementObject["ProcessorId"];
    }
  
    return (sProcessorID);
  }
  </code></pre>