SOL9 Sample: WbemNotificationQueryAsyncApplet

SOL9 2.0 Samples

1 Screenshot


2 Source code

/*
 * WbemNotificationQueryAsyncApplet.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 = .\WbemNotificationQueryAsyncResult.txt

*/

#include <sol/wmi/WbemNotificationQueryAsyncApplet.h>


void _tmain(int argc, const TCHAR** argv)
{
  //2012/10/12 Updated.
  MultiThreadedModel   multiThreaded; 

  try {
    Locale locale;
    
    //1 Create WbemQueryApplet thread

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