📄 class.com.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head> <title>COM class</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> </head> <body><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="ref.com.html">COM Functions</a></div> <div class="next" style="text-align: right; float: right;"><a href="class.dotnet.html">DOTNET</a></div> <div class="up"><a href="ref.com.html">COM Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div><hr /><div id="class.com" class="refentry"> <div class="refnamediv"> <h1 class="refname">COM</h1> <p class="verinfo">(No version information available, might be only in CVS)</p><p class="refpurpose"><span class="refname">COM</span> — <span class="dc-title">COM class</span></p> </div> <div class="refsynopsisdiv"> <pre class="synopsis">$obj = new <b class="classname">COM</b>("Application.ID")</pre> </div> <div class="refsect1 unknown"> <h3 class="title">Description</h3> <p class="simpara"> The COM class allows you to instantiate an OLE compatible COM object and call its methods and access its properties. </p> </div> <div class="refsect1 unknown"> <h3 class="title">Methods</h3> <div class="methodsynopsis dc-description"> <span class="type"><a href="class.com.html" class="type com">com</a></span> <span class="methodname"><b><b>COM::COM</b></b></span> ( <span class="methodparam"><span class="type">string</span> <tt class="parameter">$module_name</tt></span> [, <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <tt class="parameter">$server_name</tt></span> [, <span class="methodparam"><span class="type">int</span> <tt class="parameter">$codepage</tt></span> [, <span class="methodparam"><span class="type">string</span> <tt class="parameter">$typelib</tt></span> ]]] )</div> <p class="para rdfs-comment"> COM class constructor. The parameters have the following meanings: <dl> <dt> <span class="term">module_name</span> <dd> <span class="simpara"> Can be a ProgID, Class ID or Moniker that names the component to load. </span> <span class="simpara"> A ProgID is typically the application or DLL name, followed by a period, followed by the object name. e.g: <i>Word.Application</i>. </span> <span class="simpara"> A Class ID is the UUID that uniquely identifies a given class. </span> <span class="simpara"> A Moniker is a special form of naming, similar in concept to a URL scheme, that identifies a resource and specifies how it should be loaded. As an example, you could load up Word and get an object representing a word document by specifying the full path to the word document as the module name, or you can use <i>LDAP:</i> as a moniker to use the ADSI interface to LDAP. </span> </dd> </dt> <dt> <span class="term">server_name</span> <dd> <span class="simpara"> The name of the DCOM server on which the component should be loaded and run. If <b><tt>NULL</tt></b>, the object is run using the default for the application. The default is typically to run it on the local machine, although the administrator might have configured the application to launch on a different machine. </span> <span class="simpara"> If you specify a non-<b><tt>NULL</tt></b> value for server, PHP will refuse to load the object unless the <a href="com.configuration.html" class="xref">Runtime Configuration</a> configuration option is set to <b><tt>TRUE</tt></b>. </span> <p class="para"> If <i><tt class="parameter">server_name</tt></i> is an array, it should contain the following elements (case sensitive!). Note that they are all optional (although you need to specify both Username and Password together); if you omit the Server setting, the default server will be used (as mentioned above), and the instantiation of the object will not be affected by the <a href="com.configuration.html" class="xref">Runtime Configuration</a> directive. <table border="5"> <caption><b>DCOM server name</b></caption> <colgroup> <thead valign="middle"> <tr valign="middle"> <th colspan="1"><i><tt class="parameter">server_name</tt></i> key</th> <th colspan="1">type</th> <th colspan="1">description</th> </tr> </thead> <tbody valign="middle" class="tbody"> <tr valign="middle"> <td colspan="1" rowspan="1" align="left">Server</td> <td colspan="1" rowspan="1" align="left">string</td> <td colspan="1" rowspan="1" align="left">The name of the server.</td> </tr> <tr valign="middle"> <td colspan="1" rowspan="1" align="left">Username</td> <td colspan="1" rowspan="1" align="left">string</td> <td colspan="1" rowspan="1" align="left">The username to connect as.</td> </tr> <tr valign="middle"> <td colspan="1" rowspan="1" align="left">Password</td> <td colspan="1" rowspan="1" align="left">string</td> <td colspan="1" rowspan="1" align="left">The password for <i><tt class="parameter">Username</tt></i>.</td> </tr> <tr valign="middle"> <td colspan="1" rowspan="1" align="left">Flags</td> <td colspan="1" rowspan="1" align="left">integer</td> <td colspan="1" rowspan="1" align="left">One or more of the following constants, logically OR'd together: <b><tt>CLSCTX_INPROC_SERVER</tt></b>, <b><tt>CLSCTX_INPROC_HANDLER</tt></b>, <b><tt>CLSCTX_LOCAL_SERVER</tt></b>, <b><tt>CLSCTX_REMOTE_SERVER</tt></b>, <b><tt>CLSCTX_SERVER</tt></b> and <b><tt>CLSCTX_ALL</tt></b>. The default value if not specified here is <b><tt>CLSCTX_SERVER</tt></b> if you also omit <i><tt class="parameter">Server</tt></i>, or <b><tt>CLSCTX_REMOTE_SERVER</tt></b> if you do specify a server. You should consult the Microsoft documentation for CoCreateInstance for more information on the meaning of these constants; you will typically never have to use them. </td> </tr> </tbody> </colgroup> </table> </p> </dd> </dt> <dt> <span class="term">codepage</span> <dd> <span class="simpara"> Specifies the codepage that is used to convert strings to unicode-strings and vice versa. The conversion is applied whenever a
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -