SOL9 Sample: WbemQueryApplet

SOL9 2.0 Samples

1 Screenshot


2 Source code

/*
 * WbemQueryApplet.cpp 
 * Copyright (c) 2015 Antillia.com TOSHIYUKI ARAI. ALL RIGHTS RESERVED. 
 */


//SOL9
// 2010/05/08
// This program depends on the following 'Query.properties' file.
// Please change 'Query' property of the file for your needs.

/*
; WbemQueryApplet.Query.properties

Server    = .
Namespace = root\cimv2
Query     = select * from Win32_Bios
Namespace = root\cimv2
ReportFile = .\WbemQueryResult.txt

*/

#include <sol/wmi/WbemQueryApplet.h>

void _tmain(int argc, const TCHAR** argv)
{
  try {
    Locale locale;
    
    //1 Create WbemQueryApplet thread
    WbemQueryApplet applet;

    //2 Start query thread
    applet.start();

    //3 Wait a completion of the query thread
    applet.wait();

  } catch (HRESULT hr) {
    printf("Exception HRESULT=%0x", hr); 
  } catch (Exception& ex) {
    ex.printf();
  } catch (...) {
    printf("Unknown IException\n");
  }

}

Last modified: 2 May 2016

Copyright (c) 2016 Antillia.com ALL RIGHTS RESERVED.