hi ,
i have simple App that uses QAxObject
and according to msdn :
https://msdn.microsoft.com/en-us/lib...=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
#-------------------------------------------------
#
# 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
To copy to clipboard, switch view to plain text mode
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[])
{
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();
}
#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();
}
To copy to clipboard, switch view to plain text mode
win xp sp3
vs 2010 sp1
qt 5.4.0
Bookmarks