0BLACK0
17th February 2015, 11:53
hi ,
i have simple App that uses QAxObject
and according to msdn :
https://msdn.microsoft.com/en-us/library/aa394077%28v=vs.85%29.aspx
it have property SMBIOSBIOSVersion
but i don't know how to access this property in qt without any external libs
it just return QVariant(Invalid)
untitled.pro
#-------------------------------------------------
#
# Project created by QtCreator 2015-02-17T09:27:36
#
#-------------------------------------------------
QT -= core
QT += gui
TARGET = untitled
CONFIG += console
QT += widgets axcontainer
CONFIG -= app_bundle
TEMPLATE = app
SOURCES += main.cpp
main.cpp
#include <QApplication>
#include <QDebug>
#include <QMessageBox>
#include <QList>
#include <QByteArray>
#include <QVariant>
#include <ActiveQt/QAxBase>
#include <ActiveQt/QAxObject>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QAxObject *objIWbemLocator = new QAxObject("WbemScripting.SWbemLocator");
QAxObject *objWMIService = objIWbemLocator->querySubObject("ConnectServer(.,root\\cimv2)");
QAxObject *objStartup = objWMIService->querySubObject("ExecQuery(Select * from Win32_BIOS)");
qDebug() << "SMBIOSBIOSVersion: " << objStartup->property("SMBIOSBIOSVersion");
qDebug()<<"Hello World";
return a.exec();
}
win xp sp3
vs 2010 sp1
qt 5.4.0
i have simple App that uses QAxObject
and according to msdn :
https://msdn.microsoft.com/en-us/library/aa394077%28v=vs.85%29.aspx
it have property SMBIOSBIOSVersion
but i don't know how to access this property in qt without any external libs
it just return QVariant(Invalid)
untitled.pro
#-------------------------------------------------
#
# Project created by QtCreator 2015-02-17T09:27:36
#
#-------------------------------------------------
QT -= core
QT += gui
TARGET = untitled
CONFIG += console
QT += widgets axcontainer
CONFIG -= app_bundle
TEMPLATE = app
SOURCES += main.cpp
main.cpp
#include <QApplication>
#include <QDebug>
#include <QMessageBox>
#include <QList>
#include <QByteArray>
#include <QVariant>
#include <ActiveQt/QAxBase>
#include <ActiveQt/QAxObject>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QAxObject *objIWbemLocator = new QAxObject("WbemScripting.SWbemLocator");
QAxObject *objWMIService = objIWbemLocator->querySubObject("ConnectServer(.,root\\cimv2)");
QAxObject *objStartup = objWMIService->querySubObject("ExecQuery(Select * from Win32_BIOS)");
qDebug() << "SMBIOSBIOSVersion: " << objStartup->property("SMBIOSBIOSVersion");
qDebug()<<"Hello World";
return a.exec();
}
win xp sp3
vs 2010 sp1
qt 5.4.0