downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

com_propget> <com_message_pump
[edit] Last updated: Fri, 23 Mar 2012

view this page in

com_print_typeinfo

(PHP 4 >= 4.2.0, PHP 5)

com_print_typeinfoİncelenebilecek şekilde PHP sınıf tanımını yazar

Açıklama

bool com_print_typeinfo ( object $comNesne [, string $arayuz [, bool $baglama ]] )

İşlevin amacı olay bağlamada kullanmak için sınıf yapısının üretilmesidir. İşlevi ayrıca, içbakış arayüzlerinin desteklediği kadar, herhangi bir COM nesnesinin dökümünü üretmek için kullanabilirsiniz, görüntülemek istediğiniz arayüz adını bilmeniz gerekmektedir.

Değiştirgeler

comNesne

comNesne değiştirgesi ya COM nesnesinin bir örneği ya da tür kütüphane adı (com_load_typelib() işlevinde gösterilen kurallara göre çözümlenecektir) olmalıdır.

arayuz

Göstermek istediğiniz, IDispatch türevinden, arayüz adı.

baglama

TRUE olarak düzelenirse karşılık gelen bağlama arayüzü gösterilecektir.

Dönen Değerler

Başarı durumunda TRUE, başarısızlık durumunda FALSE döner.

Ayrıca Bakınız



add a note add a note User Contributed Notes com_print_typeinfo
Richard Lynch 03-Oct-2006 04:51
In my particular version of PHP, the second and third arguments are not, in fact, optional.

Passing in '' for both, however, yielded a bucketful of information.

YMMV
csaba at alum dot mit dot edu 14-Feb-2005 12:49
com_print_typeinfo is really useful if you're trying to figure out what properties and methods you have access to.  For example, I might do:

<?php
    $oExplorer
= new COM("Shell.Application");
   
com_print_typeinfo($oExplorer);
?>

The first line shows me the class of the object (what VBScript calls 'typename'), in my case IShellDispatch4.  It's frequently the case that if you plunk that in as the second argument to com_print_typeinfo, you get way more methods/properties coming back.  Thus:

<?php
    $oExplorer
= new COM("Shell.Application");
   
com_print_typeinfo($oExplorer, "IShellDispatch4");
?>

Furthermore, you might get additional functions listed if you try lower number suffixes (or not).  At any rate, it would be useful for PHP to have a typename function like VBScript does.  For example, if you iterate through the Windows of $oExplorer you get both IE and Explorer windows and typename is the easy way to differentiate between them.  Here's what I'm using:

<?php
   
function typeName($objCOM) {
    if (empty(
$objCOM)) return "no COM object";
    if (
gettype($objCOM)!="object") return "not a COM object";
   
ob_start();
   
com_print_typeinfo($objCOM);
   
$typeInfo = ob_get_contents();
   
ob_end_clean();
   
$pattern = "/^\\s*class (.*) \\{/";
    if (!(
$matchCnt = preg_match($pattern, $typeInfo, $aMatch))) return "Not found";
    return
$aMatch[1];
}
?>

Csaba Gabor from Vienna

 
show source | credits | stats | sitemap | contact | advertising | mirror sites