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/doc/container.doc:1 -->
|
---|
3 | <html>
|
---|
4 | <head>
|
---|
5 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
---|
6 | <title>The QAxContainer Module</title>
|
---|
7 | <style type="text/css"><!--
|
---|
8 | fn { margin-left: 1cm; text-indent: -1cm; }
|
---|
9 | a:link { color: #004faf; text-decoration: none }
|
---|
10 | a:visited { color: #672967; text-decoration: none }
|
---|
11 | body { 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 Classes</font></a>
|
---|
23 | | <a href="mainclasses.html">
|
---|
24 | <font color="#004faf">Main 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 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>The QAxContainer Module</h1>
|
---|
33 |
|
---|
34 |
|
---|
35 | <p>
|
---|
36 | <p> <!-- toc -->
|
---|
37 | <ul>
|
---|
38 | <li><a href="#1"> Introduction
|
---|
39 | </a>
|
---|
40 | <li><a href="#2"> Building the library
|
---|
41 | </a>
|
---|
42 | <li><a href="#3"> Using the library
|
---|
43 | </a>
|
---|
44 | <ul>
|
---|
45 | <li><a href="#3-1"> Distributing QAxContainer applications
|
---|
46 | </a>
|
---|
47 | </ul>
|
---|
48 | <li><a href="#4"> Instantiating COM objects
|
---|
49 | </a>
|
---|
50 | <li><a href="#5"> Accessing the object API
|
---|
51 | </a>
|
---|
52 | <ul>
|
---|
53 | <li><a href="#5-1"> Typical error messages
|
---|
54 | </a>
|
---|
55 | <ul>
|
---|
56 | <li><a href="#5-1-1"> Requested control could not be instantiated
|
---|
57 | </a>
|
---|
58 | <li><a href="#5-1-2"> QAxBase::internalInvoke: No such method
|
---|
59 | </a>
|
---|
60 | <li><a href="#5-1-3"> Error calling IDispatch member: Non-optional parameter
|
---|
61 | missing
|
---|
62 | </a>
|
---|
63 | <li><a href="#5-1-4"> Error calling IDispatch member: Type mismatch in
|
---|
64 | parameter n
|
---|
65 | </a>
|
---|
66 | <li><a href="#5-1-5"> QAxScriptManager::call(): No script provides this function
|
---|
67 | </a>
|
---|
68 | </ul>
|
---|
69 | </ul>
|
---|
70 | </ul>
|
---|
71 | <!-- endtoc -->
|
---|
72 |
|
---|
73 | <p> <h2> Introduction
|
---|
74 | </h2>
|
---|
75 | <a name="1"></a><p> The QAxContainer module provides a library implementing a <a href="qwidget.html">QWidget</a>
|
---|
76 | subclass, <a href="qaxwidget.html">QAxWidget</a>, that acts as a container for ActiveX
|
---|
77 | controls, and a <a href="qobject.html">QObject</a> subclass, <a href="qaxobject.html">QAxObject</a>, that can be used to
|
---|
78 | easily access non-visual COM objects. Scripting COM objects embedded
|
---|
79 | using these classes is possible through the <a href="qaxscript.html">QAxScript</a>, <a href="qaxscriptmanager.html">QAxScriptManager</a>
|
---|
80 | and <a href="qaxscriptengine.html">QAxScriptEngine</a> classes.
|
---|
81 | <p> This module is part of the <a href="activeqt.html">ActiveQt
|
---|
82 | framework</a>. (To make an application into an ActiveX server
|
---|
83 | see the <a href="qaxserver.html">QAxServer module</a>.)
|
---|
84 | <p> The module consists of six classes
|
---|
85 | <ol type=1>
|
---|
86 | <li> <a href="qaxbase.html">QAxBase</a> is an abstract class that provides an API to initialize
|
---|
87 | and access a COM/ActiveX object.
|
---|
88 | <li> <a href="qaxobject.html">QAxObject</a> provides a QObject that wraps a COM object.
|
---|
89 | <li> <a href="qaxwidget.html">QAxWidget</a> is a <a href="qwidget.html">QWidget</a> that wraps an ActiveX control.
|
---|
90 | <li> <a href="qaxscriptmanager.html">QAxScriptManager</a>, QAxScript and QAxScriptEngine provide an
|
---|
91 | interface to the Windows Script Host.
|
---|
92 | </ol>
|
---|
93 | <p> Some <a href="qaxcontainer-examples.html">example applications</a>
|
---|
94 | that use standard ActiveX controls to provide high level user
|
---|
95 | interface functionality are provided.
|
---|
96 | <p> <h2> Building the library
|
---|
97 | </h2>
|
---|
98 | <a name="2"></a><p> In the <tt>activeqt</tt> directory (usually <tt>QTDIR/extensions/activeqt</tt>)
|
---|
99 | enter the <tt>container</tt> subdirectory and run <tt>qmake</tt> to generate the
|
---|
100 | makefile, and use the make tool (<tt>nmake</tt> for VC++, <tt>make</tt> for Borland)
|
---|
101 | to build the library. The library <tt>qaxcontainer.lib</tt> will be linked
|
---|
102 | into <tt>QTDIR/lib</tt>.
|
---|
103 | <p> If you have a shared configuration of Qt enter the <tt>plugin</tt> subdirectory
|
---|
104 | and run <tt>qmake</tt> and your make tool to build a plugin that integrates the
|
---|
105 | <a href="qaxwidget.html">QAxWidget</a> class into <a href="designer-manual.html">Qt Designer</a>.
|
---|
106 | <p> <h2> Using the library
|
---|
107 | </h2>
|
---|
108 | <a name="3"></a><p> To build Qt applications that can host COM objects and ActiveX controls
|
---|
109 | link the application against the QAxContainer module by adding
|
---|
110 | <p> <pre>
|
---|
111 | LIBS += qaxcontainer.lib
|
---|
112 | </pre>
|
---|
113 |
|
---|
114 | <p> to the application's <tt>.pro</tt> file.
|
---|
115 | <p> <h3> Distributing QAxContainer applications
|
---|
116 | </h3>
|
---|
117 | <a name="3-1"></a><p> The QAxContainer library is static, so there is no need to redistribute
|
---|
118 | any additional files when using this module. Note however that the
|
---|
119 | ActiveX server binaries you are using might not be installed on the
|
---|
120 | target system, so you have to ship them with your package and register
|
---|
121 | them during the installation process of your application.
|
---|
122 | <p> <h2> Instantiating COM objects
|
---|
123 | </h2>
|
---|
124 | <a name="4"></a><p> To instantiate a COM object use the <a href="qaxbase.html#setControl">QAxBase::setControl</a>() API, or pass
|
---|
125 | the name of the object directly into the constructor of the <a href="qaxbase.html">QAxBase</a>
|
---|
126 | subclass you are using.
|
---|
127 | <p> The control can be specified in a variety of formats, but the fastest
|
---|
128 | and most powerful format is to use the class ID (CLSID) of the object
|
---|
129 | directly. The class ID can be prepended with information about a remote
|
---|
130 | machine that the object should run on, and can include a license key
|
---|
131 | for licensed controls.
|
---|
132 | <p> <h2> Accessing the object API
|
---|
133 | </h2>
|
---|
134 | <a name="5"></a><p> <a href="activeqt.html#ActiveQt">ActiveQt</a> provides a Qt API to the COM object, and replaces COM
|
---|
135 | datatypes with Qt equivalents. Use the <tt>dumpdoc</tt> tool to get the
|
---|
136 | documentation of the Qt API for any COM object and it's subobjects.
|
---|
137 | <p> See the <a href="qaxwidget.html">QAxWidget</a> and <a href="qaxobject.html">QAxObject</a> API documentation about how to
|
---|
138 | use this class to use ActiveX controls and COM objects in Qt
|
---|
139 | applications. To access the COM object with scripting languages use
|
---|
140 | the <a href="qaxscript.html">QAxScript</a> class.
|
---|
141 | <p> To call functions of the COM object that can not be accessed via
|
---|
142 | ActiveQt it is possible to request the COM interface directly using
|
---|
143 | <a href="qaxbase.html#queryInterface">QAxBase::queryInterface</a>(). To get a C++ definition of the respective
|
---|
144 | interface classes use the <tt>#import</tt> directive with the type library
|
---|
145 | provided with the control.
|
---|
146 | <p> <h3> Typical error messages
|
---|
147 | </h3>
|
---|
148 | <a name="5-1"></a><p> ActiveQt prints error messages to the debug output when it
|
---|
149 | encounters error situations at runtime. Usually you must run
|
---|
150 | your program in the debugger to see these messages (e.g. in Visual
|
---|
151 | Studio's Debug output).
|
---|
152 | <p> <h4> Requested control could not be instantiated
|
---|
153 | </h4>
|
---|
154 | <a name="5-1-1"></a><p> The control requested in <a href="qaxbase.html#setControl">QAxBase::setControl</a>() is not installed
|
---|
155 | on this system, or is not accessible for the current user.
|
---|
156 | <p> The control might require administrator rights, or a license key.
|
---|
157 | If the control is licensed, reimplement initialize() and use the
|
---|
158 | COM APIs to call the IClassFactory2 interface functions.
|
---|
159 | <p> <h4> QAxBase::internalInvoke: No such method
|
---|
160 | </h4>
|
---|
161 | <a name="5-1-2"></a><p> A <tt>dynamicCall()</tt> failed - the function prototype did not
|
---|
162 | match any function available in the object's API.
|
---|
163 | <p> <h4> Error calling IDispatch member: Non-optional parameter
|
---|
164 | missing
|
---|
165 | </h4>
|
---|
166 | <a name="5-1-3"></a><p> A <tt>dynamicCall()</tt> failed - the function prototype was correct,
|
---|
167 | but too few parameters were provided.
|
---|
168 | <p> <h4> Error calling IDispatch member: Type mismatch in
|
---|
169 | parameter n
|
---|
170 | </h4>
|
---|
171 | <a name="5-1-4"></a><p> A <tt>dynamicCall()</tt> failed - the function prototype was correct,
|
---|
172 | but the paramter at index <tt>n</tt> was of the wrong type and could
|
---|
173 | not be coerced to the correct type.
|
---|
174 | <p> <h4> <a href="qaxscriptmanager.html#call">QAxScriptManager::call</a>(): No script provides this function
|
---|
175 | </h4>
|
---|
176 | <a name="5-1-5"></a><p> You try to call a function that is provided through an engine
|
---|
177 | that doesn't provide introspection (ie. ActivePython or
|
---|
178 | ActivePerl). You need to call the function directly on the
|
---|
179 | respective <a href="qaxscript.html">QAxScript</a> object.
|
---|
180 |
|
---|
181 | <!-- eof -->
|
---|
182 | <p><address><hr><div align=center>
|
---|
183 | <table width=100% cellspacing=0 border=0><tr>
|
---|
184 | <td>Copyright © 2007
|
---|
185 | <a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
|
---|
186 | <td align=right><div align=right>Qt 3.3.8</div>
|
---|
187 | </table></div></address></body>
|
---|
188 | </html>
|
---|