SOL9 2.0 Sample: SWbemProcessQueryApplet

SOL9 2.0 Samples

1 Screenshot


2 Source code

/*
 * SWbemProcessQueryApplet.cpp 
 * Copyright (c) 2009 Antillia.com TOSHIYUKI ARAI. ALL RIGHTS RESERVED. 
 */



#include <sol/wmi/SWbemQueryApplet.h>


namespace SOL {

/**
 * Thread of ServiceStatus 
 */
class SWbemProcessQueryApplet: public SWbemQueryApplet {

public:    
    /**
     * Constructor
     */
    SWbemProcessQueryApplet()
    {
    
    }

public:
    virtual void display(SWbemObjectSet& objectSet)
    {
            long count = objectSet.getCount();

            for (long i = 0; i<count; i++) {
                try {
                    SWbemObject object = objectSet.itemIndex(i);
                    BString text = object.getObjectText(0);
                    printf("\n\nService No:%d %S\n", i, (const wchar_t*)text);
                    
                } catch (...) {

                }     
            }
    }

};

}


void _tmain(int argc, const TCHAR ** argv)
{

    try {
        Locale locale;
        SWbemProcessQueryApplet applet;

        
        //Start the thread of ServiceQuery
        applet.start();

        applet.wait();

    } catch (...) {

    }
}


Last modified: 24 Dec 2009

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