Greetings to Everybody:
I want to use WMI Classes in QT/2009.05 C++ but I do not know how to, I am using QT seperately mean without Eclipse, VS or anything...
I want to create a System Restore point using QT/C++ but not able to do it...in VB it is simple two line like
Set SRP = GetObject( "winmgmts:\\.\root\default:Systemrestore" )
CSRP = SRP.CreateRestorePoint( "Hacked the registry", 0, 100 )
Set SRP = GetObject( "winmgmts:\\.\root\default:Systemrestore" )
CSRP = SRP.CreateRestorePoint( "Hacked the registry", 0, 100 )
To copy to clipboard, switch view to plain text mode
but when I use in QT like
#include <comdef.h>
#include <Wbemidl.h>
#define _WIN32_DCOM
#include <iostream>
using namespace std;
#include <comdef.h>
#include <Wbemidl.h>
# pragma comment(lib, "wbemuuid.lib")
int main(int argc, char **argv)
{
HRESULT hres;
// Step 1: --------------------------------------------------
// Initialize COM. ------------------------------------------
hres = CoInitializeEx(0, COINIT_MULTITHREADED);
if (FAILED(hres)) .........
#include <comdef.h>
#include <Wbemidl.h>
#define _WIN32_DCOM
#include <iostream>
using namespace std;
#include <comdef.h>
#include <Wbemidl.h>
# pragma comment(lib, "wbemuuid.lib")
int main(int argc, char **argv)
{
HRESULT hres;
// Step 1: --------------------------------------------------
// Initialize COM. ------------------------------------------
hres = CoInitializeEx(0, COINIT_MULTITHREADED);
if (FAILED(hres)) .........
To copy to clipboard, switch view to plain text mode
then it gives errors like
Wbemidl.h no such file or directory...
comdef.h no such file or directory...
CoIntialize is not declared in this context...
Please help me, how can I use WMI classes in QT/2009.05/C++ . Also let me know if I have to add some libraries or something...
Any help would be appreciated.
Many thanks in advance
Bookmarks