title: How can I execute this WMI Query in VC++?
body: <p>I recently saw <a href="https://stackoverflow.com/questions/57124/how-to-detect-true-windows-version">this</a> Stackoverflow question about detecting the "real" version of Windows.</p>
  
  <p>I have a application that uses code thats only availible on Windows Vista and up. To maintain compatibility with Windows XP, I have created my own version which does exactly the same as the Vista code, but is nowhere near as fast as the Vista code. Currently the XP code is loaded when XP is detected from GetVersionEx(). However, obviously, when the application is run under XP compatability, this code is loaded unnecessarily. Now I know that I could check for the Vista method, but my code uses a lot of Vista-only code and I would rather not have to check if the method exists as I have already written XP checks and it would be easier just to change the one function.</p>
  
  <p>Now my question: How can run this WMI query and return the result (the Windows version) as an int AND std::string: "Select Version from Win32_OperatingSystem"</p>
  
  <p>I am using VC++ 2008.</p>