/*
* SWbemQueryOperatingSystemApplet.cpp
* Copyright (c) 2015 Antillia.com TOSHIYUKI ARAI. ALL RIGHTS RESERVED.
*/
//SOL9
// 2015/12/15
#include <sol/wmi/SWbemQueryOperatingSystem.h>
void _tmain(int argc, const TCHAR** argv)
{
try {
Locale locale;
{
//1 Create an instance of SWbemQueryOperatingSystem thread specifying select item "Caption".
SWbemQueryOperatingSystem operatingSystem("Caption");
//2 Start the query thread.
operatingSystem.start();
//3 Wait a completion of the query thread
operatingSystem.wait();
//4 Display the texts of ObjectSet.
for (long i = 0; i< operatingSystem.getObjectSetCount(); i++) {
StringT<wchar_t> name;
// Get a list of Name="Value" pair.
operatingSystem.getObjectText(i, name);
printf("%S\n", (const wchar_t*)name);
}
}
{
//1 Create an instance of SWbemQueryOperatingSystem thread specifying select item "*" (All items).
SWbemQueryOperatingSystem operatingSystem("*");
//2 Start the query thread.
operatingSystem.start();
//3 Wait a completion of the query thread
operatingSystem.wait();
//4 Display the text of ObjectSet queried.
operatingSystem.dump();
}
} catch (HRESULT hr) {
printf("Exception HRESULT=%0x", hr);
} catch (Exception& ex) {
caught(ex);
} catch (...) {
printf("Unknown exception\n");
}
}
Last modified: 30 Aug 2016
Last modified: 30 Aug 2016
Copyright (c) 2000-2016 Antillia.com ALL RIGHTS RESERVED.