[Qt-interest] ActiveQt - dumpcpp - how to get an instance?
Tom Francart
francart at gmail.com
Thu May 6 14:54:01 CEST 2010
Dear all,
I have a question regarding the use of COM object using ActiveQt. It
concerns an interface to connect with a sound level meter. From the
manufacturer I got a .tlb file, which I converted to a header file
using dumpcpp. This header file contains a series of interfaces (named
I*) and one actual coclass. However, I don't understand how I can get
an instance of an object on which to use the interfaces. The coclass
does not contain any methods to create them.
Here are some snippets from the generated header file:
namespace BasicEnvRemoteAPI {
class BASICENVREMOTEAPI_EXPORT IRemoteAPI : public QAxObject
{
public:
IRemoteAPI(IDispatch *subobject = 0, QAxObject *parent = 0)
: QAxObject((IUnknown*)subobject, parent)
{
internalRelease();
}
/*
Method ExecuteCommand
*/
inline void ExecuteCommand(const QString& commandName);
...
};
class BASICENVREMOTEAPI_EXPORT I2250Control : public QAxObject
{
public:
I2250Control(IDispatch *subobject = 0, QAxObject *parent = 0)
: QAxObject((IUnknown*)subobject, parent)
{
internalRelease();
}
/*
Method GetParameterString
*/
inline QString GetParameterString(const QString& instrumentName,
const QString& parameterName);
/*
Method GetParameterValues
*/
inline QStringList GetParameterValues(const QString&
instrumentName, const QString& parameterName, int& indexOfCurrent);
...
};
class BASICENVREMOTEAPI_EXPORT I2250Instrument : public QAxObject
{
public:
I2250Instrument(IDispatch *subobject = 0, QAxObject *parent = 0)
: QAxObject((IUnknown*)subobject, parent)
{
internalRelease();
}
/*
Method CreateJob
*/
inline void CreateJob(const QString& instrumentName, const
QString& deviceName, const QString& userName, const QString& jobName,
const QString& newJobName);
...
};
// Actual coclasses
class BASICENVREMOTEAPI_EXPORT RemoteAPI : public QAxObject
{
public:
RemoteAPI(QObject *parent = 0)
: QAxObject(parent)
{
setControl("{5bc25821-4936-4e9e-9acf-12e12adda9cc}");
}
RemoteAPI(IRemoteAPI *iface)
: QAxObject()
{
initializeFrom(iface);
delete iface;
}
RemoteAPI(IRemoteInfo *iface)
: QAxObject()
{
initializeFrom(iface);
delete iface;
}
RemoteAPI(IDisposable *iface)
: QAxObject()
{
initializeFrom(iface);
delete iface;
}
RemoteAPI(I2250Connect *iface)
: QAxObject()
{
initializeFrom(iface);
delete iface;
}
RemoteAPI(I2250Control *iface)
: QAxObject()
{
initializeFrom(iface);
delete iface;
}
RemoteAPI(I2250Instrument *iface)
: QAxObject()
{
initializeFrom(iface);
delete iface;
}
RemoteAPI(I2250Archive *iface)
: QAxObject()
{
initializeFrom(iface);
delete iface;
}
RemoteAPI(I2250Export *iface)
: QAxObject()
{
initializeFrom(iface);
delete iface;
}
RemoteAPI(I2250Update *iface)
: QAxObject()
{
initializeFrom(iface);
delete iface;
}
/*
Property ToString
*/
inline QString ToString() const; //Returns the value of ToString
/*
Property UndefinedDateTime
*/
inline QDateTime UndefinedDateTime() const; //Returns the value of
UndefinedDateTime
...
};
It starts with the declaration of several interfaces (I*) and ends
with the declaration of RemoteApi. Now according to the Qutlook
example, I would expect RemoteApi to have methods that return
instances of the interfaces, but it doesn't.
How can I get such an instance? (e.g. of I2250Control)
best regards,
and thank you for considering my question,
Tom
ps: the full header file can be found at
https://gilbert.med.kuleuven.be/~tom/qt/basicenvremoteapi.h
More information about the Qt-interest-old
mailing list