summaryrefslogtreecommitdiffstats
path: root/doc/man/man3/tqaxaggregated.3qt
blob: d0fa5e07dba0766635f2d65f6571acbc56e6dc58 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
'\" t
.TH QAxAggregated 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*-
.\" Copyright 1992-2007 Trolltech ASA.  All rights reserved.  See the
.\" license file included in the distribution for a complete license
.\" statement.
.\"
.ad l
.nh
.SH NAME
QAxAggregated \- Abstract base class for implementations of additional COM interfaces
.SH SYNOPSIS
This class is part of the \fBQt ActiveQt Extension\fR.
.PP
\fC#include <qaxbindable.h>\fR
.PP
.SS "Public Members"
.in +1c
.ti -1c
.BI "virtual long \fBqueryInterface\fR ( const QUuid & iid, void ** iface ) = 0"
.br
.in -1c
.SS "Protected Members"
.in +1c
.ti -1c
.BI "IUnknown * \fBcontrollingUnknown\fR () const"
.br
.ti -1c
.BI "QWidget * \fBwidget\fR () const"
.br
.ti -1c
.BI "QObject * \fBobject\fR () const"
.br
.in -1c
.SH DESCRIPTION
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 Qt API.
.PP
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.
.SH MEMBER FUNCTION DOCUMENTATION
.SH "IUnknown * QAxAggregated::controllingUnknown () const\fC [protected]\fR"
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.
.PP
.nf
.br
    HRESULT AxImpl::QueryInterface( REFIID iid, void **iface )
.br
    {
.br
        return controllingUnknown()->QueryInterface( iid, iface );
.br
    }
.br
.br
    unsigned long AxImpl::AddRef()
.br
    {
.br
        return controllingUnknown()->AddRef();
.br
    }
.br
.br
    unsigned long AxImpl::Release()
.br
    {
.br
        return controllingUnknown()->Release();
.br
    }
.br
.fi
.PP
The QAXAGG_IUNKNOWN macro expands to the code above, and you can use it in the class declaration of your subclass.
.SH "QObject * QAxAggregated::object () const\fC [protected]\fR"
Returns a pointer to the QObject subclass implementing the COM object. This function might return 0.
.PP
\fBWarning:\fR You must not store the returned pointer, unless you use a QGuardedPtr, since the QObject can be destroyed by ActiveQt at any time.
.SH "long QAxAggregated::queryInterface ( const QUuid & iid, void ** iface )\fC [pure virtual]\fR"
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.
.SH "QWidget * QAxAggregated::widget () const\fC [protected]\fR"
Returns a pointer to the QWidget subclass implementing the ActiveX control. This function might return 0.
.PP
\fBWarning:\fR
You must not store the returned pointer, unless you use a
QGuardedPtr, since the QWidget can be destroyed by ActiveQt at any
time.

.SH "SEE ALSO"
.BR http://doc.trolltech.com/qaxaggregated.html
.BR http://www.trolltech.com/faq/tech.html
.SH COPYRIGHT
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com.  See the
license file included in the distribution for a complete license
statement.
.SH AUTHOR
Generated automatically from the source code.
.SH BUGS
If you find a bug in Qt, please report it as described in
.BR http://doc.trolltech.com/bughowto.html .
Good bug reports help us to help you. Thank you.
.P
The definitive Qt documentation is provided in HTML format; it is
located at $QTDIR/doc/html and can be read using Qt Assistant or with
a web browser. This man page is provided as a convenience for those
users who prefer man pages, although this format is not officially
supported by Trolltech. 
.P
If you find errors in this manual page, please report them to
.BR qt-bugs@trolltech.com .
Please include the name of the manual page (tqaxaggregated.3qt) and the Qt
version (3.3.8).