SOL9 2.0 Class: SWbemEventSource

 SOL9 C++ Class Library  SOL9 Samples  SOL9 Tutorial  SOL9 FAQ  SOL9 ClassTree 

Source code

/*
 * SWbemEventSource.h 
 * Copyright (c) 2012 Antillia.com TOSHIYUKI ARAI. ALL RIGHTS RESERVED. 
 */


//\ 2012/03/08 Updated.

#pragma once

#include <sol/wmi/SWbemBaseObject.h>

namespace SOL {

class SWbemEventSource :public SWbemBaseObject {

public:
    SWbemEventSource(IDispatch* pDisp=NULL)
    :SWbemBaseObject(pDisp)
    {

    }

public:
    ISWbemEventSource* get()
    {
        return (ISWbemEventSource*)getIDispatch();
    }

public:
    SWbemEventSource& operator=(ISWbemEventSource* pDisp)
    { 
        set(pDisp);
        return *this;
    }

public:
    ISWbemObject * nextEvent( 
           __in long iTimeoutMs)
    {
        HRESULT hr = E_FAIL;
        ISWbemEventSource* source = get();
        ISWbemObject *objWbemObject = NULL;
        hr = source -> NextEvent( 
            iTimeoutMs,
            &objWbemObject);
        if (FAILED(hr)) {
            throw Exception(E_FAIL, "%s: %s", "E_FAIL",__FUNCTION__);
        }
        return objWbemObject;
    }

                

public:
    ISWbemSecurity* getSecurity_()
    {
        ISWbemSecurity* pObjWbemSecurity = NULL;
        HRESULT hr = E_FAIL;
        ISWbemEventSource* source = get();
    
        hr = source ->get_Security_( 
                &pObjWbemSecurity);

        if (FAILED(hr)) {
            throw Exception(E_FAIL, "%s: %s", "E_FAIL",__FUNCTION__);
        }
        return pObjWbemSecurity;
    }
};


}


Last modified: 1 Apr 2012

Copyright (c) 2009-2012 Antillia.com ALL RIGHTS RESERVED.