<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<phpdoc:classref xmlns:phpdoc="http://php.net/ns/phpdoc" xmlns="http://docbook.org/ns/docbook" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="class.dotnet">
 <titleabbrev>dotnet</titleabbrev>
 <title>The dotnet class</title>
 <partintro>

<!-- {{{ dotnet intro -->
  <section xml:id="dotnet.intro">
   &reftitle.intro;
   <para>
    The dotnet class allows you to instantiate a class from a .Net assembly and
    call its methods and access its properties, if the class and the methods and
    properties are <link xlink:href="&url.com.visible;">visible to COM</link>.
   </para>
   <para>
    Neither instantiating static classes nor calling static methods is supported.
    Instantiating generic classes such as <literal>System.Collections.Generic.List</literal>
    is not supported either.
   </para>
   <para>
    Some .Net classes do not implement IDispatch, so while they can be instantiated,
    calling methods or accessing properties on these classes is not supported.
   </para>
   <note>
    <para>
     You need to install the .Net runtime on your web server to take advantage
     of this feature.
    </para>
   </note>
   <note>
    <para>
     Prior to PHP 8.0.0, .Net framework 4.0 and later were not supported by the <classname>dotnet</classname>
     class. If assemblies had been registered with <command>regasm.exe</command>,
     the classes could be instantiated as <classname>com</classname> objects, though.
     As of PHP 8.0.0, .Net framework 4.0 and later are supported via the &php.ini;
     directive <link linkend="ini.com.dotnet-version">com.dotnet_version</link>.
    </para>
   </note>
  </section>
<!-- }}} -->

  <section xml:id="dotnet.synopsis">
   &reftitle.classsynopsis;

<!-- {{{ Synopsis -->
   <classsynopsis class="class">
    <ooclass>
     <classname>dotnet</classname>
    </ooclass>

    <ooclass>
     <modifier>extends</modifier>
     <classname>variant</classname>
    </ooclass>

    <classsynopsisinfo role="comment">&Methods;</classsynopsisinfo>
    <xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.dotnet')/db:refentry/db:refsect1[@role='description']/descendant::db:constructorsynopsis[@role='dotnet'])">
     <xi:fallback/>
    </xi:include>
   </classsynopsis>
<!-- }}} -->

  </section>

  <section xml:id="class.dotnet.overloadedmethods">
   <title>Overloaded Methods</title>
   <para>
    The returned object is an overloaded object, which means that PHP does
    not see any fixed methods as it does with regular classes; instead, any
    property or method accesses are passed through to COM and from there to
    DOTNET.  In other words, the .Net object is mapped through the COM
    interoperability layer provided by the .Net runtime.
   </para>
   <para>
    Once you have created a dotnet object, PHP treats it identically to any
    other COM object; all the same rules apply.
   </para>
  </section>

  <section xml:id="class.dotnet.examples">
   <title>dotnet examples</title>
   <para>
    <example xml:id="example.dotnet">
     <title>dotnet example</title>
     <programlisting role="php">
<![CDATA[
<?php
$stack = new dotnet("mscorlib", "System.Collections.Stack");
$stack->Push(".Net");
$stack->Push("Hello ");
echo $stack->Pop() . $stack->Pop();
?>
]]>
     </programlisting>
    </example>
   </para>
  </section>

 </partintro>

 &reference.com.entities.dotnet;

</phpdoc:classref>
<!-- 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:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
