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 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500
|
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.12 $ -->
<reference id="ref.com">
<title>Windows用のCOMサポート関数</title>
<titleabbrev>COM</titleabbrev>
<partintro>
<simpara>
COMは、標準化された呼び出し規約及びコンポーネントが保存されている
マシンや実行ファイルが存在するマシンの種類の実装の詳細をAPIの背後
に隠蔽することにより、(あらゆる言語により)あらゆる言語で書かれたコー
ドを再使用することを可能とする技術です。COMは、いくつかの基本的な
オブジェクトルートを有する特別なRemote Procedure Call (RPC)機構と
考えることができる。COMは、実装をインターフェイスから分離します。
</simpara>
<simpara>
COMは、バージョン管理、インターフェイスからの実装の分離、実行ファ
イルの位置や記述される言語のような実装の詳細の隠蔽を推奨します。
</simpara>
<simpara>
COM関数は、PHPのWindowsバージョンでのみ利用可能です。
</simpara>
<simpara>
COMに関するより詳細な情報については、<ulink
url="&url.comspecs;">COM規約</ulink>またはDon Boxの
<ulink url="&url.yacl;"> Yet Another COM Library (YACL)</ulink>を
参照下さい。
</simpara>
</partintro>
<refentry id="class.com">
<refnamediv>
<refname>COM</refname>
<refpurpose>COM class</refpurpose>
</refnamediv>
<refsynopsisdiv>
<synopsis>$obj = new <classname>COM</classname>("server.object")</synopsis>
</refsynopsisdiv>
<refsect1 id="class.com.class">
<title>説明</title>
<simpara>
COM クラスは、PHPスクリプトに統合された (D)COMコンポーネントのフ
レームワークを提供します。
</simpara>
</refsect1>
<refsect1 id="class.com.constructor">
<title>メソッド</title>
<methodsynopsis>
<type>string</type><methodname>COM::COM</methodname>
<methodparam><type>string</type><parameter>module_name</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>server_name</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>codepage</parameter></methodparam>
</methodsynopsis>
<para>
COM クラスのコンストラクタ。 パラメータ:
<variablelist>
<varlistentry><term>module_name</term>
<listitem>
<simpara>
リクエストされたコンポーネントの名前またはクラスID。
</simpara>
</listitem>
</varlistentry>
<varlistentry><term>server_name</term>
<listitem>
<simpara>
コンポーネントを取得するDCOMサーバの名前。
&null;の場合には、
<literal>localhost</literal>が指定されたと仮定されます。
DCOMを使用するためには、<filename>php.ini</filename>で
<constant>com.allow_dcom</constant> を
&true;に設定してある必要があります。
</simpara>
</listitem>
</varlistentry>
<varlistentry><term>codepage</term>
<listitem>
<simpara>
PHPの文字列のUNICODE文字列への変換およびその逆変換で使用され
るコードページを指定します。使用可能な値は、
<constant>CP_ACP</constant>, <constant>CP_MACCP</constant>,
<constant>CP_OEMCP</constant>,
<constant>CP_SYMBOL</constant>,
<constant>CP_THREAD_ACP</constant>,
<constant>CP_UTF7</constant>, <constant>CP_UTF8</constant>で
す。
</simpara>
</listitem>
</varlistentry>
</variablelist>
</para>
<para>
<example id="example.com1">
<title>COM の例 (1)</title>
<programlisting role="php">
<![CDATA[
// Wordを起動
$word = new COM("word.application") or die("Unable to instanciate Word");
print "Loaded Word, version {$word->Version}\n";
// 前面に表示
$word->Visible = 1;
// 空のドキュメントをオープン
$word->Documents->Add();
// 何か単純な作業をする
$word->Selection->TypeText("This is a test...");
$word->Documents[1]->SaveAs("Useless test.doc");
// Wordを閉じる
$word->Quit();
// オブジェクトを開放
$word->Release();
$word = null;
]]>
</programlisting>
</example>
</para>
<para>
<example id="example.com2">
<title>COM の例 (2)</title>
<programlisting role="php">
<![CDATA[
$conn = new COM("ADODB.Connection") or die("Cannot start ADO");
$conn->Open("Provider=SQLOLEDB; Data Source=localhost;
Initial Catalog=database; User ID=user; Password=password");
$rs = $conn->Execute("SELECT * FROM sometable"); // Recordset
$num_columns = $rs->Fields->Count();
echo $num_columns . "\n";
for ($i=0; $i < $num_columns; $i++)
{
$fld[$i] = $rs->Fields($i);
}
$rowcount = 0;
while (!$rs->EOF)
{
for ($i=0; $i < $num_columns; $i++)
{
echo $fld[$i]->value . "\t";
}
echo "\n";
$rowcount++; // 行カウンタを増やす
$rs->MoveNext();
}
$rs->Close();
$conn->Close();
$rs->Release();
$conn->Release();
$rs = null;
$conn = null;
]]>
</programlisting>
</example>
</para>
</refsect1>
</refentry>
<refentry id="class.variant">
<refnamediv>
<refname>VARIANT</refname>
<refpurpose>VARIANT クラス</refpurpose>
</refnamediv>
<refsynopsisdiv>
<synopsis>$vVar = new <classname>VARIANT</classname>($var)</synopsis>
</refsynopsisdiv>
<refsect1 id="class.variant.class">
<title>説明</title>
<simpara>
VARIANT構造体に変数をラップするための簡単なコンテナクラス。
</simpara>
</refsect1>
<refsect1 id="class.variant.constructor">
<title>メソッド</title>
<methodsynopsis>
<type>string</type><methodname>VARIANT::VARIANT</methodname>
<methodparam choice="opt"><type>mixed</type><parameter>value</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>type</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>codepage</parameter></methodparam>
</methodsynopsis>
<para>
VARIANT クラスのコンストラクタ。 パラメータ:
<variablelist>
<varlistentry><term>value</term>
<listitem>
<simpara>
初期値。省略した場合には、VT_EMPTYオブジェクトが作成されます。
</simpara>
</listitem>
</varlistentry>
<varlistentry><term>type</term>
<listitem>
<simpara>
VARIANTオブジェクトのcontent型を指定します。使用可能な値は、
<constant>VT_UI1</constant>, <constant>VT_UI2</constant>,
<constant>VT_UI4</constant>, <constant>VT_I1</constant>,
<constant>VT_I2</constant>, <constant>VT_I4</constant>,
<constant>VT_R4</constant>, <constant>VT_R8</constant>,
<constant>VT_INT</constant>, <constant>VT_UINT</constant>,
<constant>VT_BOOL</constant>, <constant>VT_ERROR</constant>,
<constant>VT_CY</constant>, <constant>VT_DATE</constant>,
<constant>VT_BSTR</constant>,
<constant>VT_DECIMAL</constant>,
<constant>VT_UNKNOWN</constant>,
<constant>VT_DISPATCH</constant>,
<constant>VT_VARIANT</constant>です。これらの値は相互に排他的
ですが、値があることを指定するために
<constant>VT_BYREF</constant>を組み合わせることが可能です。
省略された場合には、<parameter>value</parameter> の型が使用さ
れます。その他の情報については、MSDNライブラリを参照下さい。
</simpara>
</listitem>
</varlistentry>
<varlistentry><term>codepage</term>
<listitem>
<simpara>
PHPの文字列のUNICODE文字列への変換およびその逆変換で使用され
るコードページを指定します。使用可能な値は、
<constant>CP_ACP</constant>, <constant>CP_MACCP</constant>,
<constant>CP_OEMCP</constant>,
<constant>CP_SYMBOL</constant>,
<constant>CP_THREAD_ACP</constant>,
<constant>CP_UTF7</constant>, <constant>CP_UTF8</constant>で
す。
</simpara>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
</refentry>
<refentry id="function.com-load">
<refnamediv>
<refname>com_load</refname>
<refpurpose>
COMコンポーネントへの新規リファレンスを作成する
</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>string</type><methodname>com_load</methodname>
<methodparam><type>string</type><parameter>module name</parameter></methodparam>
<methodparam><type>string</type><parameter>
<replaceable><optional>server name</optional></replaceable>
</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>
codepage
</parameter></methodparam>
</methodsynopsis>
<para>
<function>com_load</function>は、新規のCOMコンポーネントを作成し、
このコンポーネントへのリファレンスを返します。失敗した場合に
&false;を返します。
Possible values for <parameter>codepage</parameter> are
<constant>CP_ACP</constant>, <constant>CP_MACCP</constant>,
<constant>CP_OEMCP</constant>, <constant>CP_SYMBOL</constant>,
<constant>CP_THREAD_ACP</constant>, <constant>CP_UTF7</constant>
and <constant>CP_UTF8</constant>.
</para>
</refsect1>
</refentry>
<refentry id="function.com-invoke">
<refnamediv>
<refname>com_invoke</refname>
<refpurpose>
COMコンポーネントのメソッドをコールします。
</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>mixed</type><methodname>com_invoke</methodname>
<methodparam><type>resource</type><parameter>com_object</parameter></methodparam>
<methodparam><type>string</type><parameter>function_name</parameter></methodparam>
<methodparam><type>mixed</type><parameter>
<replaceable>
<optional>function parameters, ...</optional>
</replaceable>
</parameter></methodparam>
</methodsynopsis>
<para>
<function>com_invoke</function>は、
<parameter>com_object</parameter>が指すCOMコンポーネントのメソッ
ドをコールします。エラーの場合に&false;を返し、
成功時に<parameter>function_name</parameter>の返り値を返します。
</para>
</refsect1>
</refentry>
<refentry id="function.com-propget">
<refnamediv>
<refname>com_propget</refname>
<refpurpose>
COMコンポーネントのプロパティの値を得る
</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>mixed</type><methodname>com_propget</methodname>
<methodparam><type>resource</type><parameter>com_object</parameter></methodparam>
<methodparam><type>string</type><parameter>property</parameter></methodparam>
</methodsynopsis>
<para>
この関数は、<function>com_get</function>へのエイリアスです。
</para>
</refsect1>
</refentry>
<refentry id="function.com-get">
<refnamediv>
<refname>com_get</refname>
<refpurpose>
COMコンポーネントのプロパティの値を得る
</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>mixed</type><methodname>com_get</methodname>
<methodparam><type>resource</type><parameter>com_object</parameter></methodparam>
<methodparam><type>string</type><parameter>property</parameter></methodparam>
</methodsynopsis>
<para>
<parameter>com_object</parameter>が指すCOMコンポーネントの
<parameter>property</parameter>の値を返します。エラー時に
&false;を返します。
</para>
</refsect1>
</refentry>
<refentry id="function.com-propput">
<refnamediv>
<refname>com_propput</refname>
<refpurpose>
COMコンポーネントのプロパティに値を代入する
</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>void</type><methodname>com_propput</methodname>
<methodparam><type>resource</type><parameter>com_object</parameter></methodparam>
<methodparam><type>string</type><parameter>property</parameter></methodparam>
<methodparam><type>mixed</type><parameter>value</parameter></methodparam>
</methodsynopsis>
<para>
この関数は、<function>com_set</function>へのエイリアスです。
</para>
</refsect1>
</refentry>
<refentry id="function.com-propset">
<refnamediv>
<refname>com_propset</refname>
<refpurpose>
COMコンポーネントのプロパティに値を代入する
</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>void</type><methodname>com_propset</methodname>
<methodparam><type>resource</type><parameter>com_object</parameter></methodparam>
<methodparam><type>string</type><parameter>property</parameter></methodparam>
<methodparam><type>mixed</type><parameter>value</parameter></methodparam>
</methodsynopsis>
<para>
この関数は、<function>com_set</function>へのエイリアスです。
</para>
</refsect1>
</refentry>
<refentry id="function.com-set">
<refnamediv>
<refname>com_set</refname>
<refpurpose>
COMコンポーネントのプロパティに値を代入する
</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>void</type><methodname>com_set</methodname>
<methodparam><type>resource</type><parameter>com_object</parameter></methodparam>
<methodparam><type>string</type><parameter>property</parameter></methodparam>
<methodparam><type>mixed</type><parameter>value</parameter></methodparam>
</methodsynopsis>
<para>
<parameter>com_object</parameter>が指すCOMコンポーネントの
<parameter>property</parameter>の値を設定します。成功時に新規に設
定された値、エラーの場合に&false;を返します。
</para>
</refsect1>
</refentry>
<refentry id="function.com-addref">
<refnamediv>
<refname>com_addref</refname>
<refpurpose>
コンポーネントリファレンスカウンタを増やす
</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>void</type><methodname>com_addref</methodname>
<void/>
</methodsynopsis>
<para>
コンポーネントリファレンスカウンタを増やします。
</para>
</refsect1>
</refentry>
<refentry id="function.com-release">
<refnamediv>
<refname>com_release</refname>
<refpurpose>
コンポーネントリファレンスカウンタを減らす
</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>void</type><methodname>com_release</methodname>
<void/>
</methodsynopsis>
<para>
コンポーネントリファレンスカウンタを減らします。
</para>
</refsect1>
</refentry>
<refentry id='function.com-isenum'>
<refnamediv>
<refname>com_isenum</refname>
<refpurpose>IEnumVariantを取得する</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>void</type><methodname>com_isenum</methodname>
<methodparam><type>object</type><parameter>com_module</parameter></methodparam>
</methodsynopsis>
<para>
&warn.undocumented.func;
</para>
</refsect1>
</refentry>
<refentry id='function.com-load-typelib'>
<refnamediv>
<refname>com_load_typelib</refname>
<refpurpose>Typelibをロードする</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>void</type><methodname>com_load_typelib</methodname>
<methodparam><type>string</type><parameter>typelib_name</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>case_insensitive</parameter></methodparam>
</methodsynopsis>
<para>
&warn.undocumented.func;
</para>
</refsect1>
</refentry>
</reference>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
-->
|