Hi,
I recently saw this Stackoverflow question about detecting the "real" version of Windows.
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.
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"
I am using VC++ 2008.