SOL9 Sample: WbemNotificationQueryApplet

SOL9 2.0 Samples

1 Screenshot


2 Source code

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


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

/*
; WbemNotificationQueryApplet.Query.properties

Server    = .
Namespace = root\cimv2
Query     = SELECT * FROM __InstanceCreationEvent WITHIN 1 WHERE TargetInstance ISA 'Win32_Process'
Namespace = root\cimv2
ReportFile = .\WbemNotificationQueryResult.txt

*/

#include <sol/wmi/WbemNotificationQueryApplet.h>


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

    WbemNotificationQueryApplet 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.