This class is defined in the \fBQt ActiveQt Extension\fR, which can be found in the \fCqt/extensions\fR directory. It is not included in the main TQt API.
The QAxAggregated class is an abstract base class for implementations of additional COM interfaces.
.PP
Create a subclass of QAxAggregated and reimplement queryInterface() to support additional COM interfaces. Use multiple inheritance from those COM interfaces. Implement the IUnknown interface of those COM interfaces by delegating the calls to QueryInterface(), AddRef() and Release() to the interface provided by controllingUnknown().
.PP
Use the widget() method if you need to make calls to the QWidget implementing the ActiveX control. You must not store that pointer in your subclass (unless you use QGuardedPtr), as the QWidget can be destroyed by the ActiveQt framework at any time.
Returns the IUnknown interface of the ActiveX control. Implement the IUnknown interface in your QAxAggregated subclass to delegate calls to QueryInterface(), AddRef() and Release() to the interface provided by this function.
Reimplement this pure virtual function to support additional COM interfaces. Set the value of \fIiface\fR to point to this object to support the interface \fIiid\fR. Note that you must cast the \fCthis\fR pointer to the appropriate superclass.
.PP
.nf
.br
long AxImpl::queryInterface( const QUuid &iid, void **iface )
.br
{
.br
*iface = 0;
.br
if ( iid == IID_ISomeCOMInterface )
.br
*iface = (ISomeCOMInterface*)this;
.br
else
.br
return E_NOINTERFACE;
.br
.br
AddRef();
.br
return S_OK;
.br
}
.br
.fi
.PP
Return the standard COM results S_OK (interface is supported) or E_NOINTERFACE (requested interface is not supported).
.PP
\fBWarning:\fR Even though you must implement the IUnknown interface if you implement any COM interface you must not support the IUnknown interface in your queryInterface() implementation.