source: trunk/doc/html/qaxaggregated.html@ 208

Last change on this file since 208 was 190, checked in by rudi, 14 years ago

reference documentation added

File size: 6.7 KB
Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2<!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/extensions/activeqt/control/qaxbindable.cpp:185 -->
3<html>
4<head>
5<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
6<title>QAxAggregated Class</title>
7<style type="text/css"><!--
8fn { margin-left: 1cm; text-indent: -1cm; }
9a:link { color: #004faf; text-decoration: none }
10a:visited { color: #672967; text-decoration: none }
11body { background: #ffffff; color: black; }
12--></style>
13</head>
14<body>
15
16<table border="0" cellpadding="0" cellspacing="0" width="100%">
17<tr bgcolor="#E5E5E5">
18<td valign=center>
19 <a href="index.html">
20<font color="#004faf">Home</font></a>
21 | <a href="classes.html">
22<font color="#004faf">All&nbsp;Classes</font></a>
23 | <a href="mainclasses.html">
24<font color="#004faf">Main&nbsp;Classes</font></a>
25 | <a href="annotated.html">
26<font color="#004faf">Annotated</font></a>
27 | <a href="groups.html">
28<font color="#004faf">Grouped&nbsp;Classes</font></a>
29 | <a href="functions.html">
30<font color="#004faf">Functions</font></a>
31</td>
32<td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>QAxAggregated Class Reference<br><small>[<a href="qaxserver.html">QAxServer module</a>]</small></h1>
33
34<p>The QAxAggregated class is an abstract base class for implementations of
35additional COM interfaces.
36<a href="#details">More...</a>
37<p>This class is part of the <b>Qt ActiveQt Extension</b>.
38<p><tt>#include &lt;<a href="qaxbindable-h.html">qaxbindable.h</a>&gt;</tt>
39<p><a href="qaxaggregated-members.html">List of all member functions.</a>
40<h2>Public Members</h2>
41<ul>
42<li class=fn>virtual long <a href="#queryInterface"><b>queryInterface</b></a> ( const&nbsp;QUuid&nbsp;&amp;&nbsp;iid, void&nbsp;**&nbsp;iface ) = 0</li>
43</ul>
44<h2>Protected Members</h2>
45<ul>
46<li class=fn>IUnknown * <a href="#controllingUnknown"><b>controllingUnknown</b></a> () const</li>
47<li class=fn>QWidget * <a href="#widget"><b>widget</b></a> () const</li>
48<li class=fn>QObject * <a href="#object"><b>object</b></a> () const</li>
49</ul>
50<hr><a name="details"></a><h2>Detailed Description</h2>
51<p> This class is defined in the <b>Qt <a href="activeqt.html#ActiveQt">ActiveQt</a> Extension</b>, which can be found in the <tt>qt/extensions</tt> directory. It is not included in the main Qt API.
52<p>
53
54The QAxAggregated class is an abstract base class for implementations of
55additional COM interfaces.
56
57<p>
58
59<p> Create a subclass of QAxAggregated and reimplement
60<a href="#queryInterface">queryInterface</a>() to support additional COM interfaces. Use
61multiple inheritance from those COM interfaces. Implement the
62IUnknown interface of those COM interfaces by delegating the calls
63to QueryInterface(), AddRef() and Release() to the interface
64provided by <a href="#controllingUnknown">controllingUnknown</a>().
65<p> Use the <a href="#widget">widget</a>() method if you need to make calls to the <a href="qwidget.html">QWidget</a>
66implementing the ActiveX control. You must not store that pointer
67in your subclass (unless you use <a href="qguardedptr.html">QGuardedPtr</a>), as the QWidget can
68be destroyed by the ActiveQt framework at any time.
69
70<hr><h2>Member Function Documentation</h2>
71<h3 class=fn>IUnknown * <a name="controllingUnknown"></a>QAxAggregated::controllingUnknown () const<tt> [protected]</tt>
72</h3>
73
74<p> Returns the IUnknown interface of the ActiveX control. Implement
75the IUnknown interface in your QAxAggregated subclass to delegate
76calls to QueryInterface(), AddRef() and Release() to the interface
77provided by this function.
78<p> <pre>
79 HRESULT AxImpl::QueryInterface( REFIID iid, void **iface )
80 {
81 return controllingUnknown()-&gt;QueryInterface( iid, iface );
82 }
83
84 unsigned long AxImpl::AddRef()
85 {
86 return controllingUnknown()-&gt;AddRef();
87 }
88
89 unsigned long AxImpl::Release()
90 {
91 return controllingUnknown()-&gt;Release();
92 }
93 </pre>
94
95<p> The QAXAGG_IUNKNOWN macro expands to the code above, and you can
96use it in the class declaration of your subclass.
97
98<h3 class=fn><a href="qobject.html">QObject</a>&nbsp;* <a name="object"></a>QAxAggregated::object () const<tt> [protected]</tt>
99</h3>
100
101<p> Returns a pointer to the <a href="qobject.html">QObject</a> subclass implementing the COM object.
102This function might return 0.
103<p> <b>Warning:</b>
104You must not store the returned pointer, unless you use a
105<a href="qguardedptr.html">QGuardedPtr</a>, since the QObject can be destroyed by <a href="activeqt.html#ActiveQt">ActiveQt</a> at any
106time.
107
108<h3 class=fn>long <a name="queryInterface"></a>QAxAggregated::queryInterface ( const&nbsp;<a href="quuid.html">QUuid</a>&nbsp;&amp;&nbsp;iid, void&nbsp;**&nbsp;iface )<tt> [pure virtual]</tt>
109</h3>
110
111<p> Reimplement this pure virtual function to support additional COM
112interfaces. Set the value of <em>iface</em> to point to this object to
113support the interface <em>iid</em>. Note that you must cast the <tt>this</tt> pointer to the appropriate superclass.
114<p> <pre>
115 long AxImpl::queryInterface( const <a href="quuid.html">QUuid</a> &amp;iid, void **iface )
116 {
117 *iface = 0;
118 if ( iid == IID_ISomeCOMInterface )
119 *iface = (ISomeCOMInterface*)this;
120 else
121 return E_NOINTERFACE;
122
123 AddRef();
124 return S_OK;
125 }
126 </pre>
127
128<p> Return the standard COM results S_OK (interface is supported) or
129E_NOINTERFACE (requested interface is not supported).
130<p> <b>Warning:</b>
131Even though you must implement the IUnknown interface if you
132implement any COM interface you must not support the IUnknown
133interface in your <a href="#queryInterface">queryInterface</a>() implementation.
134
135<h3 class=fn><a href="qwidget.html">QWidget</a>&nbsp;* <a name="widget"></a>QAxAggregated::widget () const<tt> [protected]</tt>
136</h3>
137
138<p> Returns a pointer to the <a href="qwidget.html">QWidget</a> subclass implementing the ActiveX control.
139This function might return 0.
140<p> <b>Warning:</b>
141You must not store the returned pointer, unless you use a
142<a href="qguardedptr.html">QGuardedPtr</a>, since the QWidget can be destroyed by <a href="activeqt.html#ActiveQt">ActiveQt</a> at any
143time.
144
145<!-- eof -->
146<hr><p>
147This file is part of the <a href="index.html">Qt toolkit</a>.
148Copyright &copy; 1995-2007
149<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
150<table width=100% cellspacing=0 border=0><tr>
151<td>Copyright &copy; 2007
152<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
153<td align=right><div align=right>Qt 3.3.8</div>
154</table></div></address></body>
155</html>
Note: See TracBrowser for help on using the repository browser.