Sophie

Sophie

distrib > Mageia > 7 > x86_64 > by-pkgid > 1dd17e0d683ef79b4bb6872bbf359d7f > files > 4891

qt4-doc-4.8.7-26.2.mga7.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qaxfactory.cpp -->
  <title>Qt 4.8: QAxFactory Class Reference</title>
  <link rel="stylesheet" type="text/css" href="style/style.css" />
  <script src="scripts/jquery.js" type="text/javascript"></script>
  <script src="scripts/functions.js" type="text/javascript"></script>
  <link rel="stylesheet" type="text/css" href="style/superfish.css" />
  <link rel="stylesheet" type="text/css" href="style/narrow.css" />
  <!--[if IE]>
<meta name="MSSmartTagsPreventParsing" content="true">
<meta http-equiv="imagetoolbar" content="no">
<![endif]-->
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie6.css">
<![endif]-->
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie7.css">
<![endif]-->
<!--[if IE 8]>
<link rel="stylesheet" type="text/css" href="style/style_ie8.css">
<![endif]-->

<script src="scripts/superfish.js" type="text/javascript"></script>
<script src="scripts/narrow.js" type="text/javascript"></script>

</head>
<body class="" onload="CheckEmptyAndLoadList();">
 <div class="header" id="qtdocheader">
    <div class="content"> 
    <div id="nav-logo">
      <a href="index.html">Home</a></div>
    <a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
    <div id="narrowsearch"></div>
    <div id="nav-topright">
      <ul>
        <li class="nav-topright-home"><a href="http://qt.digia.com/">Qt HOME</a></li>
        <li class="nav-topright-dev"><a href="http://qt-project.org/">DEV</a></li>
        <li class="nav-topright-doc nav-topright-doc-active"><a href="http://qt-project.org/doc/">
          DOC</a></li>
        <li class="nav-topright-blog"><a href="http://blog.qt.digia.com/">BLOG</a></li>
      </ul>
    </div>
    <div id="shortCut">
      <ul>
        <li class="shortCut-topleft-inactive"><span><a href="index.html">Qt 4.8</a></span></li>
        <li class="shortCut-topleft-active"><a href="http://qt-project.org/doc/">ALL VERSIONS        </a></li>
      </ul>
     </div>
 <ul class="sf-menu" id="narrowmenu"> 
             <li><a href="#">API Lookup</a> 
                 <ul> 
                     <li><a href="classes.html">Class index</a></li> 
           <li><a href="functions.html">Function index</a></li> 
           <li><a href="modules.html">Modules</a></li> 
           <li><a href="namespaces.html">Namespaces</a></li> 
           <li><a href="qtglobal.html">Global Declarations</a></li> 
           <li><a href="qdeclarativeelements.html">QML elements</a></li> 
             </ul> 
             </li> 
             <li><a href="#">Qt Topics</a> 
                 <ul> 
                        <li><a href="qt-basic-concepts.html">Programming with Qt</a></li>  
                        <li><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li>  
                        <li><a href="qt-gui-concepts.html">UI Design with Qt</a></li>  
                        <li><a href="supported-platforms.html">Supported Platforms</a></li>  
                        <li><a href="technology-apis.html">Qt and Key Technologies</a></li>  
                        <li><a href="best-practices.html">How-To's and Best Practices</a></li>  
              </ul> 
                 </li> 
                 <li><a href="#">Examples</a> 
                     <ul> 
                       <li><a href="all-examples.html">Examples</a></li> 
                       <li><a href="tutorials.html">Tutorials</a></li> 
                       <li><a href="demos.html">Demos</a></li> 
                       <li><a href="qdeclarativeexamples.html">QML Examples</a></li> 
                </ul> 
                     </li> 
                 </ul> 
    </div>
  </div>
  <div class="wrapper">
    <div class="hd">
      <span></span>
    </div>
    <div class="bd group">
      <div class="sidebar">
        <div class="searchlabel">
          Search index:</div>
        <div class="search" id="sidebarsearch">
          <form id="qtdocsearch" action="" onsubmit="return false;">
            <fieldset>
              <input type="text" name="searchstring" id="pageType" value="" />
 <div id="resultdialog"> 
 <a href="#" id="resultclose">Close</a> 
 <p id="resultlinks" class="all"><a href="#" id="showallresults">All</a> | <a href="#" id="showapiresults">API</a> | <a href="#" id="showarticleresults">Articles</a> | <a href="#" id="showexampleresults">Examples</a></p> 
 <p id="searchcount" class="all"><span id="resultcount"></span><span id="apicount"></span><span id="articlecount"></span><span id="examplecount"></span>&nbsp;results:</p> 
 <ul id="resultlist" class="all"> 
 </ul> 
 </div> 
            </fieldset>
          </form>
        </div>
        <div class="box first bottombar" id="lookup">
          <h2 title="API Lookup"><span></span>
            API Lookup</h2>
          <div  id="list001" class="list">
          <ul id="ul001" >
              <li class="defaultLink"><a href="classes.html">Class index</a></li>
              <li class="defaultLink"><a href="functions.html">Function index</a></li>
              <li class="defaultLink"><a href="modules.html">Modules</a></li>
              <li class="defaultLink"><a href="namespaces.html">Namespaces</a></li>
              <li class="defaultLink"><a href="qtglobal.html">Global Declarations</a></li>
              <li class="defaultLink"><a href="qdeclarativeelements.html">QML elements</a></li>
            </ul> 
          </div>
        </div>
        <div class="box bottombar" id="topics">
          <h2 title="Qt Topics"><span></span>
            Qt Topics</h2>
          <div id="list002" class="list">
            <ul id="ul002" >
               <li class="defaultLink"><a href="qt-basic-concepts.html">Programming with Qt</a></li> 
               <li class="defaultLink"><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li> 
               <li class="defaultLink"><a href="qt-gui-concepts.html">UI Design with Qt</a></li> 
               <li class="defaultLink"><a href="supported-platforms.html">Supported Platforms</a></li>  
               <li class="defaultLink"><a href="technology-apis.html">Qt and Key Technologies</a></li> 
               <li class="defaultLink"><a href="best-practices.html">How-To's and Best Practices</a></li> 
            </ul>  
          </div>
        </div>
        <div class="box" id="examples">
          <h2 title="Examples"><span></span>
            Examples</h2>
          <div id="list003" class="list">
        <ul id="ul003">
              <li class="defaultLink"><a href="all-examples.html">Examples</a></li>
              <li class="defaultLink"><a href="tutorials.html">Tutorials</a></li>
              <li class="defaultLink"><a href="demos.html">Demos</a></li>
              <li class="defaultLink"><a href="qdeclarativeexamples.html">QML Examples</a></li>
            </ul> 
          </div>
        </div>
      </div>
      <div class="wrap">
        <div class="toolbar">
          <div class="breadcrumb toolblock">
            <ul>
              <li class="first"><a href="index.html">Home</a></li>
              <!--  Breadcrumbs go here -->
<li><a href="modules.html">Modules</a></li>
<li><a href="qaxserver.html">QAxServer</a></li>
<li>QAxFactory</li>
            </ul>
          </div>
          <div class="toolbuttons toolblock">
            <ul>
              <li id="smallA" class="t_button">A</li>
              <li id="medA" class="t_button active">A</li>
              <li id="bigA" class="t_button">A</li>
              <li id="print" class="t_button"><a href="javascript:this.print();">
                <span>Print</span></a></li>
            </ul>
        </div>
        </div>
        <div class="content mainContent">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-types">Public Types</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#static-public-members">Static Public Members</a></li>
<li class="level1"><a href="#macros">Macros</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<h1 class="title">QAxFactory Class Reference</h1>
<!-- $$$QAxFactory-brief -->
<p>The QAxFactory class defines a factory for the creation of COM components. <a href="#details">More...</a></p>
<!-- @@@QAxFactory -->
<pre class="cpp"> <span class="preprocessor">#include &lt;QAxFactory&gt;</span></pre><p><b>Inherits: </b><a href="qobject.html">QObject</a>.</p>
<ul>
<li><a href="qaxfactory-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-types"></a>
<h2>Public Types</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qaxfactory.html#ServerType-enum">ServerType</a></b> { SingleInstance, MultipleInstances }</td></tr>
</table>
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qaxfactory.html#QAxFactory">QAxFactory</a></b> ( const QUuid &amp; <i>libid</i>, const QUuid &amp; <i>appid</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual </td><td class="memItemRight bottomAlign"><b><a href="qaxfactory.html#dtor.QAxFactory">~QAxFactory</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QUuid </td><td class="memItemRight bottomAlign"><b><a href="qaxfactory.html#appID">appID</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QUuid </td><td class="memItemRight bottomAlign"><b><a href="qaxfactory.html#classIDx">classID</a></b> ( const QString &amp; <i>key</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QObject * </td><td class="memItemRight bottomAlign"><b><a href="qaxfactory.html#createObject">createObject</a></b> ( const QString &amp; <i>key</i> ) = 0</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qaxfactory.html#createObjectWrapper">createObjectWrapper</a></b> ( QObject * <i>object</i>, IDispatch ** <i>wrapper</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QUuid </td><td class="memItemRight bottomAlign"><b><a href="qaxfactory.html#eventsID">eventsID</a></b> ( const QString &amp; <i>key</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QString </td><td class="memItemRight bottomAlign"><b><a href="qaxfactory.html#exposeToSuperClass">exposeToSuperClass</a></b> ( const QString &amp; <i>key</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QStringList </td><td class="memItemRight bottomAlign"><b><a href="qaxfactory.html#featureList">featureList</a></b> () const = 0</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qaxfactory.html#hasStockEvents">hasStockEvents</a></b> ( const QString &amp; <i>key</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QUuid </td><td class="memItemRight bottomAlign"><b><a href="qaxfactory.html#interfaceID">interfaceID</a></b> ( const QString &amp; <i>key</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qaxfactory.html#isService">isService</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual const QMetaObject * </td><td class="memItemRight bottomAlign"><b><a href="qaxfactory.html#metaObject">metaObject</a></b> ( const QString &amp; <i>key</i> ) const = 0</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qaxfactory.html#registerClass">registerClass</a></b> ( const QString &amp; <i>key</i>, QSettings * <i>settings</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qaxfactory.html#stayTopLevel">stayTopLevel</a></b> ( const QString &amp; <i>key</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QUuid </td><td class="memItemRight bottomAlign"><b><a href="qaxfactory.html#typeLibID">typeLibID</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qaxfactory.html#unregisterClass">unregisterClass</a></b> ( const QString &amp; <i>key</i>, QSettings * <i>settings</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qaxfactory.html#validateLicenseKey">validateLicenseKey</a></b> ( const QString &amp; <i>key</i>, const QString &amp; <i>licenseKey</i> ) const</td></tr>
</table>
<ul>
<li class="fn">29 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li>
</ul>
<a name="static-public-members"></a>
<h2>Static Public Members</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qaxfactory.html#isServer">isServer</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qaxfactory.html#registerActiveObject">registerActiveObject</a></b> ( QObject * <i>object</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qaxfactory.html#serverDirPath">serverDirPath</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qaxfactory.html#serverFilePath">serverFilePath</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qaxfactory.html#startServer">startServer</a></b> ( ServerType <i>type</i> = MultipleInstances )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qaxfactory.html#stopServer">stopServer</a></b> ()</td></tr>
</table>
<ul>
<li class="fn">7 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li>
</ul>
<a name="macros"></a>
<h2>Macros</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qaxfactory.html#QAXCLASS">QAXCLASS</a></b> (  <i>Class</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qaxfactory.html#QAXFACTORY_BEGIN">QAXFACTORY_BEGIN</a></b> (  <i>IDTypeLib</i>,  <i>IDApp</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qaxfactory.html#QAXFACTORY_DEFAULT">QAXFACTORY_DEFAULT</a></b> (  <i>Class</i>,  <i>ClassID</i>,  <i>InterfaceID</i>,  <i>EventID</i>,  <i>LibID</i>,  <i>AppID</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qaxfactory.html#QAXFACTORY_END">QAXFACTORY_END</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qaxfactory.html#QAXFACTORY_EXPORT">QAXFACTORY_EXPORT</a></b> (  <i>Class</i>,  <i>LibID</i>,  <i>AppID</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qaxfactory.html#QAXTYPE">QAXTYPE</a></b> (  <i>Class</i> )</td></tr>
</table>
<h3>Additional Inherited Members</h3>
<ul>
<li class="fn">1 property inherited from <a href="qobject.html#properties">QObject</a></li>
<li class="fn">1 public slot inherited from <a href="qobject.html#public-slots">QObject</a></li>
<li class="fn">1 signal inherited from <a href="qobject.html#signals">QObject</a></li>
<li class="fn">8 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
</ul>
<a name="details"></a>
<!-- $$$QAxFactory-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The QAxFactory class defines a factory for the creation of COM components.</p>
<p>Implement this factory once in your COM server to provide information about the components the server can create. Subclass QAxFactory and implement the pure virtual functions in any implementation file (e.g&#x2e; main.cpp), and export the factory using the <tt>QAXFACTORY_EXPORT()</tt> macro.</p>
<pre class="cpp"> <span class="type"><a href="qstringlist.html">QStringList</a></span> ActiveQtFactory<span class="operator">::</span><a href="qaxfactory.html#featureList">featureList</a>() <span class="keyword">const</span>
 {
     <span class="type"><a href="qstringlist.html">QStringList</a></span> list;
     list <span class="operator">&lt;</span><span class="operator">&lt;</span> <span class="string">&quot;ActiveX1&quot;</span>;
     list <span class="operator">&lt;</span><span class="operator">&lt;</span> <span class="string">&quot;ActiveX2&quot;</span>;
     <span class="keyword">return</span> list;
 }

 <span class="type"><a href="qobject.html">QObject</a></span> <span class="operator">*</span>ActiveQtFactory<span class="operator">::</span><a href="qaxfactory.html#createObject">createObject</a>(<span class="keyword">const</span> <span class="type"><a href="qstring.html">QString</a></span> <span class="operator">&amp;</span>key)
 {
     <span class="keyword">if</span> (key <span class="operator">=</span><span class="operator">=</span> <span class="string">&quot;ActiveX1&quot;</span>)
         <span class="keyword">return</span> <span class="keyword">new</span> ActiveX1(parent);
     <span class="keyword">if</span> (key <span class="operator">=</span><span class="operator">=</span> <span class="string">&quot;ActiveX2&quot;</span>)
         <span class="keyword">return</span> <span class="keyword">new</span> ActiveX2(parent);
     <span class="keyword">return</span> <span class="number">0</span>;
 }

 <span class="keyword">const</span> <span class="type"><a href="qmetaobject.html">QMetaObject</a></span> <span class="operator">*</span>ActiveQtFactory<span class="operator">::</span><a href="qaxfactory.html#metaObject">metaObject</a>(<span class="keyword">const</span> <span class="type"><a href="qstring.html">QString</a></span> <span class="operator">&amp;</span>key) <span class="keyword">const</span>
 {
     <span class="keyword">if</span> (key <span class="operator">=</span><span class="operator">=</span> <span class="string">&quot;ActiveX1&quot;</span>)
         <span class="keyword">return</span> <span class="operator">&amp;</span>ActiveX1<span class="operator">::</span>staticMetaObject;
     <span class="keyword">if</span> (key <span class="operator">=</span><span class="operator">=</span> <span class="string">&quot;ActiveX2&quot;</span>)
         <span class="keyword">return</span> <span class="operator">&amp;</span>ActiveX2<span class="operator">::</span>staticMetaObject;
 }

 <span class="type"><a href="quuid.html">QUuid</a></span> ActiveQtFactory<span class="operator">::</span><a href="qaxfactory.html#classIDx">classID</a>(<span class="keyword">const</span> <span class="type"><a href="qstring.html">QString</a></span> <span class="operator">&amp;</span>key) <span class="keyword">const</span>
 {
     <span class="keyword">if</span> (key <span class="operator">=</span><span class="operator">=</span> <span class="string">&quot;ActiveX1&quot;</span>)
         <span class="keyword">return</span> <span class="string">&quot;{01234567-89AB-CDEF-0123-456789ABCDEF}&quot;</span>;
     <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
     <span class="keyword">return</span> <span class="type"><a href="quuid.html">QUuid</a></span>();
 }

 <span class="type"><a href="quuid.html">QUuid</a></span> ActiveQtFactory<span class="operator">::</span><a href="qaxfactory.html#interfaceID">interfaceID</a>(<span class="keyword">const</span> <span class="type"><a href="qstring.html">QString</a></span> <span class="operator">&amp;</span>key) <span class="keyword">const</span>
 {
     <span class="keyword">if</span> (key <span class="operator">=</span><span class="operator">=</span> <span class="string">&quot;ActiveX1&quot;</span>)
         <span class="keyword">return</span> <span class="string">&quot;{01234567-89AB-CDEF-0123-456789ABCDEF}&quot;</span>;
     <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
     <span class="keyword">return</span> <span class="type"><a href="quuid.html">QUuid</a></span>();
 }

 <span class="type"><a href="quuid.html">QUuid</a></span> ActiveQtFactory<span class="operator">::</span><a href="qaxfactory.html#eventsID">eventsID</a>(<span class="keyword">const</span> <span class="type"><a href="qstring.html">QString</a></span> <span class="operator">&amp;</span>key) <span class="keyword">const</span>
 {
     <span class="keyword">if</span> (key <span class="operator">=</span><span class="operator">=</span> <span class="string">&quot;ActiveX1&quot;</span>)
         <span class="keyword">return</span> <span class="string">&quot;{01234567-89AB-CDEF-0123-456789ABCDEF}&quot;</span>;
     <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
     <span class="keyword">return</span> <span class="type"><a href="quuid.html">QUuid</a></span>();
 }

 <a href="qaxfactory.html#QAXFACTORY_EXPORT">QAXFACTORY_EXPORT</a>(
     ActiveQtFactory<span class="operator">,</span>                          <span class="comment">// factory class</span>
     <span class="string">&quot;{01234567-89AB-CDEF-0123-456789ABCDEF}&quot;</span><span class="operator">,</span> <span class="comment">// type library ID</span>
     <span class="string">&quot;{01234567-89AB-CDEF-0123-456789ABCDEF}&quot;</span>  <span class="comment">// application ID</span>
 )</pre>
<p>If you use the <tt>Q_CLASSINFO()</tt> macro to provide the unique identifiers or other attributes for your class you can use the <tt>QAXFACTORY_BEGIN()</tt>, <tt>QAXCLASS()</tt> and <tt>QAXFACTORY_END()</tt> macros to expose one or more classes as COM objects.</p>
<pre class="cpp"> <a href="qaxfactory.html#QAXFACTORY_BEGIN">QAXFACTORY_BEGIN</a>(
     <span class="string">&quot;{01234567-89AB-CDEF-0123-456789ABCDEF}&quot;</span><span class="operator">,</span> <span class="comment">// type library ID</span>
     <span class="string">&quot;{01234567-89AB-CDEF-0123-456789ABCDEF}&quot;</span>  <span class="comment">// application ID</span>
 )
     <a href="qaxfactory.html#QAXCLASS">QAXCLASS</a>(Class1)
     <a href="qaxfactory.html#QAXCLASS">QAXCLASS</a>(Class2)
 <a href="qaxfactory.html#QAXFACTORY_END">QAXFACTORY_END</a>()</pre>
<p>If your server supports just a single COM object, you can use a default factory implementation through the <tt>QAXFACTORY_DEFAULT()</tt> macro.</p>
<pre class="cpp"> <span class="preprocessor">#include &lt;qapplication.h&gt;</span>
 <span class="preprocessor">#include &lt;qaxfactory.h&gt;</span>

 <span class="preprocessor">#include &quot;theactivex.h&quot;</span>

 <a href="qaxfactory.html#QAXFACTORY_DEFAULT">QAXFACTORY_DEFAULT</a>(
     TheActiveX<span class="operator">,</span>                           <span class="comment">// widget class</span>
     <span class="string">&quot;{01234567-89AB-CDEF-0123-456789ABCDEF}&quot;</span><span class="operator">,</span> <span class="comment">// class ID</span>
     <span class="string">&quot;{01234567-89AB-CDEF-0123-456789ABCDEF}&quot;</span><span class="operator">,</span> <span class="comment">// interface ID</span>
     <span class="string">&quot;{01234567-89AB-CDEF-0123-456789ABCDEF}&quot;</span><span class="operator">,</span> <span class="comment">// event interface ID</span>
     <span class="string">&quot;{01234567-89AB-CDEF-0123-456789ABCDEF}&quot;</span><span class="operator">,</span> <span class="comment">// type library ID</span>
     <span class="string">&quot;{01234567-89AB-CDEF-0123-456789ABCDEF}&quot;</span>  <span class="comment">// application ID</span>
 )</pre>
<p>Only one QAxFactory implementation may be instantiated and exported by an ActiveX server application. This instance is accessible through the global qAxFactory() function.</p>
<p>A factory can also reimplement the <a href="qaxfactory.html#registerClass">registerClass</a>() and <a href="qaxfactory.html#unregisterClass">unregisterClass</a>() functions to set additional flags for an ActiveX control in the registry. To limit the number of methods or properties a widget class exposes from its parent classes reimplement <a href="qaxfactory.html#exposeToSuperClass">exposeToSuperClass</a>().</p>
</div>
<p><b>See also </b><a href="qaxaggregated.html">QAxAggregated</a>, <a href="qaxbindable.html">QAxBindable</a>, and <a href="activeqt.html#activeqt-framework">ActiveQt Framework</a>.</p>
<!-- @@@QAxFactory -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$ServerType$$$SingleInstance$$$MultipleInstances -->
<h3 class="fn"><a name="ServerType-enum"></a>enum QAxFactory::<span class="name">ServerType</span></h3>
<p>This enum specifies the different types of servers that can be started with startServer.</p>
<table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><tt>QAxFactory::SingleInstance</tt></td><td class="topAlign"><tt>0</tt></td><td class="topAlign">The server process can create only one instance of each exported class. COM starts a new process for each request. This is typically used in servers that export only one creatable class.</td></tr>
<tr><td class="topAlign"><tt>QAxFactory::MultipleInstances</tt></td><td class="topAlign"><tt>1</tt></td><td class="topAlign">The server can create multiple instances of each exported class. This is the default. All instances will live in the same thread, and will share static resources.</td></tr>
</table>
<!-- @@@ServerType -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QAxFactory[overload1]$$$QAxFactoryconstQUuid&constQUuid& -->
<h3 class="fn"><a name="QAxFactory"></a>QAxFactory::<span class="name">QAxFactory</span> ( const <span class="type"><a href="quuid.html">QUuid</a></span> &amp; <i>libid</i>, const <span class="type"><a href="quuid.html">QUuid</a></span> &amp; <i>appid</i> )</h3>
<p>Constructs a <a href="qaxfactory.html">QAxFactory</a> object that returns <i>libid</i> and <i>appid</i> in the implementation of the respective interface functions.</p>
<!-- @@@QAxFactory -->
<!-- $$$~QAxFactory[overload1]$$$~QAxFactory -->
<h3 class="fn"><a name="dtor.QAxFactory"></a>QAxFactory::<span class="name">~QAxFactory</span> ()<tt> [virtual]</tt></h3>
<p>Destroys the <a href="qaxfactory.html">QAxFactory</a> object.</p>
<!-- @@@~QAxFactory -->
<!-- $$$appID[overload1]$$$appID -->
<h3 class="fn"><a name="appID"></a><span class="type"><a href="quuid.html">QUuid</a></span> QAxFactory::<span class="name">appID</span> () const<tt> [virtual]</tt></h3>
<p>Reimplement this function to return the ActiveX server's application identifier.</p>
<!-- @@@appID -->
<!-- $$$classID[overload1]$$$classIDconstQString& -->
<h3 class="fn"><a name="classIDx"></a><span class="type"><a href="quuid.html">QUuid</a></span> QAxFactory::<span class="name">classID</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>key</i> ) const<tt> [virtual]</tt></h3>
<p>Reimplement this function to return the class identifier for each <i>key</i> returned by the <a href="qaxfactory.html#featureList">featureList</a>() implementation, or an empty <a href="quuid.html">QUuid</a> if this factory doesn't support the value of <i>key</i>.</p>
<p>The default implementation interprets <i>key</i> as the class name, and returns the value of the <a href="qobject.html#Q_CLASSINFO">Q_CLASSINFO</a>() entry &quot;ClassID&quot;.</p>
<!-- @@@classID -->
<!-- $$$createObject[overload1]$$$createObjectconstQString& -->
<h3 class="fn"><a name="createObject"></a><span class="type"><a href="qobject.html">QObject</a></span> * QAxFactory::<span class="name">createObject</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>key</i> )<tt> [pure virtual]</tt></h3>
<p>Reimplement this function to return a new object for <i>key</i>, or 0 if this factory doesn't support the value of <i>key</i>.</p>
<p>If the object returned is a <a href="qwidget.html">QWidget</a> it will be exposed as an ActiveX control, otherwise the returned object will be exposed as a simple COM object.</p>
<!-- @@@createObject -->
<!-- $$$createObjectWrapper[overload1]$$$createObjectWrapperQObject*IDispatch** -->
<h3 class="fn"><a name="createObjectWrapper"></a><span class="type">bool</span> QAxFactory::<span class="name">createObjectWrapper</span> ( <span class="type"><a href="qobject.html">QObject</a></span> * <i>object</i>, <span class="type">IDispatch</span> ** <i>wrapper</i> )<tt> [virtual]</tt></h3>
<p>Reimplement this function to provide the COM object for <i>object</i> in <i>wrapper</i>. Return true if the function was successful; otherwise return false.</p>
<p>The default implementation creates a generic automation wrapper based on the meta object information of <i>object</i>.</p>
<!-- @@@createObjectWrapper -->
<!-- $$$eventsID[overload1]$$$eventsIDconstQString& -->
<h3 class="fn"><a name="eventsID"></a><span class="type"><a href="quuid.html">QUuid</a></span> QAxFactory::<span class="name">eventsID</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>key</i> ) const<tt> [virtual]</tt></h3>
<p>Reimplement this function to return the identifier of the event interface for each <i>key</i> returned by the <a href="qaxfactory.html#featureList">featureList</a>() implementation, or an empty <a href="quuid.html">QUuid</a> if this factory doesn't support the value of <i>key</i>.</p>
<p>The default implementation interprets <i>key</i> as the class name, and returns the value of the <a href="qobject.html#Q_CLASSINFO">Q_CLASSINFO</a>() entry &quot;EventsID&quot;.</p>
<!-- @@@eventsID -->
<!-- $$$exposeToSuperClass[overload1]$$$exposeToSuperClassconstQString& -->
<h3 class="fn"><a name="exposeToSuperClass"></a><span class="type"><a href="qstring.html">QString</a></span> QAxFactory::<span class="name">exposeToSuperClass</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>key</i> ) const<tt> [virtual]</tt></h3>
<p>Reimplement this function to return the name of the super class of <i>key</i> up to which methods and properties should be exposed by the ActiveX control.</p>
<p>The default implementation interprets <i>key</i> as the class name, and returns the value of the <tt>Q_CLASSINFO()</tt> entry &quot;ToSuperClass&quot;. If no such value is set the null-string is returned, and the functions and properties of all the super classes including <a href="qwidget.html">QWidget</a> will be exposed.</p>
<p>To only expose the functions and properties of the class itself, reimplement this function to return <i>key</i>.</p>
<!-- @@@exposeToSuperClass -->
<!-- $$$featureList[overload1]$$$featureList -->
<h3 class="fn"><a name="featureList"></a><span class="type"><a href="qstringlist.html">QStringList</a></span> QAxFactory::<span class="name">featureList</span> () const<tt> [pure virtual]</tt></h3>
<p>Reimplement this function to return a list of the widgets (class names) supported by this factory.</p>
<!-- @@@featureList -->
<!-- $$$hasStockEvents[overload1]$$$hasStockEventsconstQString& -->
<h3 class="fn"><a name="hasStockEvents"></a><span class="type">bool</span> QAxFactory::<span class="name">hasStockEvents</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>key</i> ) const<tt> [virtual]</tt></h3>
<p>Reimplement this function to return true if the ActiveX control <i>key</i> should support the standard ActiveX events</p>
<ul>
<li>Click</li>
<li>DblClick</li>
<li>KeyDown</li>
<li>KeyPress</li>
<li>KeyUp</li>
<li>MouseDown</li>
<li>MouseUp</li>
<li>MouseMove</li>
</ul>
<p>The default implementation interprets <i>key</i> as the class name, and returns true if the value of the <tt>Q_CLASSINFO()</tt> entry &quot;StockEvents&quot; is &quot;yes&quot;. Otherwise this function returns false.</p>
<!-- @@@hasStockEvents -->
<!-- $$$interfaceID[overload1]$$$interfaceIDconstQString& -->
<h3 class="fn"><a name="interfaceID"></a><span class="type"><a href="quuid.html">QUuid</a></span> QAxFactory::<span class="name">interfaceID</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>key</i> ) const<tt> [virtual]</tt></h3>
<p>Reimplement this function to return the interface identifier for each <i>key</i> returned by the <a href="qaxfactory.html#featureList">featureList</a>() implementation, or an empty <a href="quuid.html">QUuid</a> if this factory doesn't support the value of <i>key</i>.</p>
<p>The default implementation interprets <i>key</i> as the class name, and returns the value of the <a href="qobject.html#Q_CLASSINFO">Q_CLASSINFO</a>() entry &quot;InterfaceID&quot;.</p>
<!-- @@@interfaceID -->
<!-- $$$isServer[overload1]$$$isServer -->
<h3 class="fn"><a name="isServer"></a><span class="type">bool</span> QAxFactory::<span class="name">isServer</span> ()<tt> [static]</tt></h3>
<p>Returns true if the application has been started (by COM) as an ActiveX server, otherwise returns false.</p>
<pre class="cpp"> <span class="type">int</span> main(<span class="type">int</span> argc<span class="operator">,</span> <span class="type">char</span> <span class="operator">*</span>argv<span class="operator">[</span><span class="operator">]</span>)
 {
     <span class="type"><a href="qapplication.html">QApplication</a></span> app(argc<span class="operator">,</span> argv);
     <span class="keyword">if</span> (<span class="operator">!</span><span class="type"><a href="qaxfactory.html">QAxFactory</a></span><span class="operator">::</span>isServer()) {
         <span class="comment">// initialize for stand-alone execution</span>
     }
     <span class="keyword">return</span> app<span class="operator">.</span>exec();
 }</pre>
<!-- @@@isServer -->
<!-- $$$isService[overload1]$$$isService -->
<h3 class="fn"><a name="isService"></a><span class="type">bool</span> QAxFactory::<span class="name">isService</span> () const<tt> [virtual]</tt></h3>
<p>Reimplement this function to return true if the server is running as a persistent service (e.g&#x2e; an NT service) and should not terminate even when all objects provided have been released.</p>
<p>The default implementation returns false.</p>
<!-- @@@isService -->
<!-- $$$metaObject[overload1]$$$metaObjectconstQString& -->
<h3 class="fn"><a name="metaObject"></a>const <span class="type"><a href="qmetaobject.html">QMetaObject</a></span> * QAxFactory::<span class="name">metaObject</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>key</i> ) const<tt> [pure virtual]</tt></h3>
<p>Reimplement this function to return the <a href="qmetaobject.html">QMetaObject</a> corresponding to <i>key</i>, or 0 if this factory doesn't support the value of <i>key</i>.</p>
<!-- @@@metaObject -->
<!-- $$$registerActiveObject[overload1]$$$registerActiveObjectQObject* -->
<h3 class="fn"><a name="registerActiveObject"></a><span class="type">bool</span> QAxFactory::<span class="name">registerActiveObject</span> ( <span class="type"><a href="qobject.html">QObject</a></span> * <i>object</i> )<tt> [static]</tt></h3>
<p>Registers the <a href="qobject.html">QObject</a> <i>object</i> with COM as a running object, and returns true if the registration succeeded, otherwise returns false. The object is unregistered automatically when it is destroyed.</p>
<p>This function should only be called if the application has been started by the user (i.e&#x2e; not by COM to respond to a request), and only for one object, usually the toplevel object of the application's object hierarchy.</p>
<p>This function does nothing and returns false if the object's class info for &quot;RegisterObject&quot; is not set to &quot;yes&quot;, or if the server is an in-process server.</p>
<!-- @@@registerActiveObject -->
<!-- $$$registerClass[overload1]$$$registerClassconstQString&QSettings* -->
<h3 class="fn"><a name="registerClass"></a><span class="type">void</span> QAxFactory::<span class="name">registerClass</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>key</i>, <span class="type"><a href="qsettings.html">QSettings</a></span> * <i>settings</i> ) const<tt> [virtual]</tt></h3>
<p>Registers additional values for the class <i>key</i> in the system registry using the <i>settings</i> object. The standard values have already been registered by the framework, but additional values, e.g&#x2e; implemented categories, can be added in an implementation of this function.</p>
<pre class="cpp"> settings<span class="operator">-</span><span class="operator">&gt;</span>setValue(<span class="string">&quot;/CLSID/&quot;</span> <span class="operator">+</span> classID(key)
                    <span class="operator">+</span> <span class="string">&quot;/Implemented Categories/&quot;</span>
                    <span class="operator">+</span> <span class="string">&quot;/{00000000-0000-0000-000000000000}/.&quot;</span><span class="operator">,</span>
                    <span class="type"><a href="qstring.html">QString</a></span>());</pre>
<p>If you reimplement this function you must also reimplement <a href="qaxfactory.html#unregisterClass">unregisterClass</a>() to remove the additional registry values.</p>
<p><b>See also </b><a href="qsettings.html">QSettings</a>.</p>
<!-- @@@registerClass -->
<!-- $$$serverDirPath[overload1]$$$serverDirPath -->
<h3 class="fn"><a name="serverDirPath"></a><span class="type"><a href="qstring.html">QString</a></span> QAxFactory::<span class="name">serverDirPath</span> ()<tt> [static]</tt></h3>
<p>Returns the directory that contains the server binary.</p>
<p>For out-of-process servers this is the same as <a href="qcoreapplication.html#applicationDirPath">QApplication::applicationDirPath</a>(). For in-process servers that function returns the directory that contains the hosting application.</p>
<!-- @@@serverDirPath -->
<!-- $$$serverFilePath[overload1]$$$serverFilePath -->
<h3 class="fn"><a name="serverFilePath"></a><span class="type"><a href="qstring.html">QString</a></span> QAxFactory::<span class="name">serverFilePath</span> ()<tt> [static]</tt></h3>
<p>Returns the file path of the server binary.</p>
<p>For out-of-process servers this is the same as <a href="qcoreapplication.html#applicationFilePath">QApplication::applicationFilePath</a>(). For in-process servers that function returns the file path of the hosting application.</p>
<!-- @@@serverFilePath -->
<!-- $$$startServer[overload1]$$$startServerServerType -->
<h3 class="fn"><a name="startServer"></a><span class="type">bool</span> QAxFactory::<span class="name">startServer</span> ( <span class="type"><a href="qaxfactory.html#ServerType-enum">ServerType</a></span> <i>type</i> = MultipleInstances )<tt> [static]</tt></h3>
<p>Starts the COM server with <i>type</i> and returns true if successful, otherwise returns false.</p>
<p>Calling this function if the server is already running (or for an in-process server) does nothing and returns true.</p>
<p>The server is started automatically with <i>type</i> set to <tt>MultipleInstances</tt> if the server executable has been started with the <tt>-activex</tt> command line parameter. To switch to <a href="qaxfactory.html#ServerType-enum">SingleInstance</a>, call</p>
<pre class="cpp"> <span class="keyword">if</span> (<span class="type"><a href="qaxfactory.html">QAxFactory</a></span><span class="operator">::</span>isServer()) {
     <span class="type"><a href="qaxfactory.html">QAxFactory</a></span><span class="operator">::</span>stopServer();
     <span class="type"><a href="qaxfactory.html">QAxFactory</a></span><span class="operator">::</span>startServer(<span class="type"><a href="qaxfactory.html">QAxFactory</a></span><span class="operator">::</span>SingleInstance);
 }</pre>
<p>in your own main() entry point function.</p>
<!-- @@@startServer -->
<!-- $$$stayTopLevel[overload1]$$$stayTopLevelconstQString& -->
<h3 class="fn"><a name="stayTopLevel"></a><span class="type">bool</span> QAxFactory::<span class="name">stayTopLevel</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>key</i> ) const<tt> [virtual]</tt></h3>
<p>Reimplement this function to return true if the ActiveX control <i>key</i> should be a top level window, e.g&#x2e; a dialog. The default implementation returns false.</p>
<!-- @@@stayTopLevel -->
<!-- $$$stopServer[overload1]$$$stopServer -->
<h3 class="fn"><a name="stopServer"></a><span class="type">bool</span> QAxFactory::<span class="name">stopServer</span> ()<tt> [static]</tt></h3>
<p>Stops the COM server and returns true if successful, otherwise returns false.</p>
<p>Calling this function if the server is not running (or for an in-process server) does nothing and returns true.</p>
<p>Stopping the server will not invalidate existing objects, but no new objects can be created from the existing server process. Usually COM will start a new server process if additional objects are requested.</p>
<p>The server is stopped automatically when the main() function returns.</p>
<!-- @@@stopServer -->
<!-- $$$typeLibID[overload1]$$$typeLibID -->
<h3 class="fn"><a name="typeLibID"></a><span class="type"><a href="quuid.html">QUuid</a></span> QAxFactory::<span class="name">typeLibID</span> () const<tt> [virtual]</tt></h3>
<p>Reimplement this function to return the ActiveX server's type library identifier.</p>
<!-- @@@typeLibID -->
<!-- $$$unregisterClass[overload1]$$$unregisterClassconstQString&QSettings* -->
<h3 class="fn"><a name="unregisterClass"></a><span class="type">void</span> QAxFactory::<span class="name">unregisterClass</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>key</i>, <span class="type"><a href="qsettings.html">QSettings</a></span> * <i>settings</i> ) const<tt> [virtual]</tt></h3>
<p>Unregisters any additional values for the class <i>key</i> from the system registry using the <i>settings</i> object.</p>
<pre class="cpp"> settings<span class="operator">-</span><span class="operator">&gt;</span>remove(<span class="string">&quot;/CLSID/&quot;</span> <span class="operator">+</span> classID(key)
                  <span class="operator">+</span> <span class="string">&quot;/Implemented Categories&quot;</span>
                  <span class="operator">+</span> <span class="string">&quot;/{00000000-0000-0000-000000000000}/.&quot;</span>);</pre>
<p><b>See also </b><a href="qaxfactory.html#registerClass">registerClass</a>() and <a href="qsettings.html">QSettings</a>.</p>
<!-- @@@unregisterClass -->
<!-- $$$validateLicenseKey[overload1]$$$validateLicenseKeyconstQString&constQString& -->
<h3 class="fn"><a name="validateLicenseKey"></a><span class="type">bool</span> QAxFactory::<span class="name">validateLicenseKey</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>key</i>, const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>licenseKey</i> ) const<tt> [virtual]</tt></h3>
<p>Reimplement this function to return true if <i>licenseKey</i> is a valid license for the class <i>key</i>, or if the current machine is licensed.</p>
<p>The default implementation returns true if the class <i>key</i> is not licensed (ie. no <tt>Q_CLASSINFO()</tt> attribute &quot;LicenseKey&quot;), or if <i>licenseKey</i> matches the value of the &quot;LicenseKey&quot; attribute, or if the machine is licensed through a .LIC file with the same filename as this COM server.</p>
<!-- @@@validateLicenseKey -->
</div>
<div class="macros">
<h2>Macro Documentation</h2>
<!-- $$$QAXCLASS[overload1]$$$QAXCLASS -->
<h3 class="fn"><a name="QAXCLASS"></a><span class="name">QAXCLASS</span> (  <i>Class</i> )</h3>
<p>This macro adds a creatable COM class <i>Class</i> to the <a href="qaxfactory.html">QAxFactory</a> declared with the <a href="qaxfactory.html#QAXFACTORY_BEGIN">QAXFACTORY_BEGIN</a>() macro.</p>
<p><b>See also </b><a href="qaxfactory.html#QAXFACTORY_BEGIN">QAXFACTORY_BEGIN</a>(), <a href="qaxfactory.html#QAXTYPE">QAXTYPE</a>(), <a href="qaxfactory.html#QAXFACTORY_END">QAXFACTORY_END</a>(), and <a href="qobject.html#Q_CLASSINFO">Q_CLASSINFO</a>().</p>
<!-- @@@QAXCLASS -->
<!-- $$$QAXFACTORY_BEGIN[overload1]$$$QAXFACTORY_BEGIN -->
<h3 class="fn"><a name="QAXFACTORY_BEGIN"></a><span class="name">QAXFACTORY_BEGIN</span> (  <i>IDTypeLib</i>,  <i>IDApp</i> )</h3>
<p>This macro can be used to export multiple <a href="qobject.html">QObject</a> classes through an implicitly declared <a href="qaxfactory.html">QAxFactory</a> implementation. All <a href="qobject.html">QObject</a> classes have to declare the ClassID, InterfaceID and EventsID (if applicable) through the <a href="qobject.html#Q_CLASSINFO">Q_CLASSINFO</a>() macro. All declarations will be in a type library with the id <i>IDTypeLib</i>, and if the server is an executable server then it will have the application id <i>IDApp</i>.</p>
<p>This macro needs to be used together with the <a href="qaxfactory.html#QAXCLASS">QAXCLASS</a>(), <a href="qaxfactory.html#QAXTYPE">QAXTYPE</a>() and <a href="qaxfactory.html#QAXFACTORY_END">QAXFACTORY_END</a>() macros.</p>
<pre class="cpp"> QAXFACTORY_BEGIN(
     <span class="string">&quot;{01234567-89AB-CDEF-0123-456789ABCDEF}&quot;</span><span class="operator">,</span> <span class="comment">// type library ID</span>
     <span class="string">&quot;{01234567-89AB-CDEF-0123-456789ABCDEF}&quot;</span>  <span class="comment">// application ID</span>
 )
     <a href="qaxfactory.html#QAXCLASS">QAXCLASS</a>(Class1)
     <a href="qaxfactory.html#QAXCLASS">QAXCLASS</a>(Class2)
 <a href="qaxfactory.html#QAXFACTORY_END">QAXFACTORY_END</a>()</pre>
<!-- @@@QAXFACTORY_BEGIN -->
<!-- $$$QAXFACTORY_DEFAULT[overload1]$$$QAXFACTORY_DEFAULT -->
<h3 class="fn"><a name="QAXFACTORY_DEFAULT"></a><span class="name">QAXFACTORY_DEFAULT</span> (  <i>Class</i>,  <i>ClassID</i>,  <i>InterfaceID</i>,  <i>EventID</i>,  <i>LibID</i>,  <i>AppID</i> )</h3>
<p>This macro can be used to export a single <a href="qobject.html">QObject</a> subclass <i>Class</i> a this COM server through an implicitly declared <a href="qaxfactory.html">QAxFactory</a> implementation.</p>
<p>This macro exports the class <i>Class</i> as a COM coclass with the CLSID <i>ClassID</i>. The properties and slots will be declared through a COM interface with the IID <i>InterfaceID</i>, and signals will be declared through a COM event interface with the IID <i>EventID</i>. All declarations will be in a type library with the id <i>LibID</i>, and if the server is an executable server then it will have the application id <i>AppID</i>.</p>
<pre class="cpp"> <span class="preprocessor">#include &lt;qaxfactory.h&gt;</span>

 <span class="preprocessor">#include &quot;theactivex.h&quot;</span>

 QAXFACTORY_DEFAULT(
     TheActiveX<span class="operator">,</span>                           <span class="comment">// widget class</span>
     <span class="string">&quot;{01234567-89AB-CDEF-0123-456789ABCDEF}&quot;</span><span class="operator">,</span> <span class="comment">// class ID</span>
     <span class="string">&quot;{01234567-89AB-CDEF-0123-456789ABCDEF}&quot;</span><span class="operator">,</span> <span class="comment">// interface ID</span>
     <span class="string">&quot;{01234567-89AB-CDEF-0123-456789ABCDEF}&quot;</span><span class="operator">,</span> <span class="comment">// event interface ID</span>
     <span class="string">&quot;{01234567-89AB-CDEF-0123-456789ABCDEF}&quot;</span><span class="operator">,</span> <span class="comment">// type library ID</span>
     <span class="string">&quot;{01234567-89AB-CDEF-0123-456789ABCDEF}&quot;</span>  <span class="comment">// application ID</span>
 )</pre>
<p><b>See also </b><a href="qaxfactory.html#QAXFACTORY_EXPORT">QAXFACTORY_EXPORT</a>() and <a href="qaxfactory.html#QAXFACTORY_BEGIN">QAXFACTORY_BEGIN</a>().</p>
<!-- @@@QAXFACTORY_DEFAULT -->
<!-- $$$QAXFACTORY_END[overload1]$$$QAXFACTORY_END -->
<h3 class="fn"><a name="QAXFACTORY_END"></a><span class="name">QAXFACTORY_END</span> ()</h3>
<p>Completes the <a href="qaxfactory.html">QAxFactory</a> declaration started with the <a href="qaxfactory.html#QAXFACTORY_BEGIN">QAXFACTORY_BEGIN</a>() macro.</p>
<p><b>See also </b><a href="qaxfactory.html#QAXFACTORY_BEGIN">QAXFACTORY_BEGIN</a>(), <a href="qaxfactory.html#QAXCLASS">QAXCLASS</a>(), and <a href="qaxfactory.html#QAXTYPE">QAXTYPE</a>().</p>
<!-- @@@QAXFACTORY_END -->
<!-- $$$QAXFACTORY_EXPORT[overload1]$$$QAXFACTORY_EXPORT -->
<h3 class="fn"><a name="QAXFACTORY_EXPORT"></a><span class="name">QAXFACTORY_EXPORT</span> (  <i>Class</i>,  <i>LibID</i>,  <i>AppID</i> )</h3>
<p>This macro can be used to export a <a href="qaxfactory.html">QAxFactory</a> implementation <i>Class</i> from a COM server. All declarations will be in a type library with the id <i>LibID</i>, and if the server is an executable server then it will have the application id <i>AppID</i>.</p>
<pre class="cpp"> QAXFACTORY_EXPORT(
     MyFactory<span class="operator">,</span>                                <span class="comment">// factory class</span>
     <span class="string">&quot;{01234567-89AB-CDEF-0123-456789ABCDEF}&quot;</span><span class="operator">,</span> <span class="comment">// type library ID</span>
     <span class="string">&quot;{01234567-89AB-CDEF-0123-456789ABCDEF}&quot;</span>  <span class="comment">// application ID</span>
 )</pre>
<p><b>See also </b><a href="qaxfactory.html#QAXFACTORY_BEGIN">QAXFACTORY_BEGIN</a>().</p>
<!-- @@@QAXFACTORY_EXPORT -->
<!-- $$$QAXTYPE[overload1]$$$QAXTYPE -->
<h3 class="fn"><a name="QAXTYPE"></a><span class="name">QAXTYPE</span> (  <i>Class</i> )</h3>
<p>This macro adds a non-creatable COM class <i>Class</i> to the <a href="qaxfactory.html">QAxFactory</a> declared with the <a href="qaxfactory.html#QAXFACTORY_BEGIN">QAXFACTORY_BEGIN</a>(). The class <i>Class</i> can be used in APIs of other COM classes exported through QAXTYPE() or <a href="qaxfactory.html#QAXCLASS">QAXCLASS</a>().</p>
<p>Instances of type <i>Class</i> can only be retrieved using APIs of already instantiated objects.</p>
<p><b>See also </b><a href="qaxfactory.html#QAXFACTORY_BEGIN">QAXFACTORY_BEGIN</a>(), <a href="qaxfactory.html#QAXCLASS">QAXCLASS</a>(), <a href="qaxfactory.html#QAXFACTORY_END">QAXFACTORY_END</a>(), and <a href="qobject.html#Q_CLASSINFO">Q_CLASSINFO</a>().</p>
<!-- @@@QAXTYPE -->
</div>
      </div>
    </div>
    </div> 
    <div class="ft">
      <span></span>
    </div>
  </div> 
  <div class="footer">
    <p>
      <acronym title="Copyright">&copy;</acronym> 2015 The Qt Company Ltd.
      Documentation contributions included herein are the copyrights of
      their respective owners.</p>
    <br />
    <p>
      The documentation provided herein is licensed under the terms of the
      <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation
      License version 1.3</a> as published by the Free Software Foundation.</p>
    <p>
      Documentation sources may be obtained from <a href="http://www.qt-project.org">
      www.qt-project.org</a>.</p>
    <br />
    <p>
      Qt and respective logos are trademarks of The Qt Company Ltd 
      in Finland and/or other countries worldwide. All other trademarks are property
      of their respective owners. <a title="Privacy Policy"
      href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p>
  </div>

  <script src="scripts/functions.js" type="text/javascript"></script>
</body>
</html>