com_print_typeinfo() - com组件
com_print_typeinfo()
(PHP 4 >= 4.2.0, PHP 5, PHP 7)
Print out a PHP class definition for a dispatchable interface
说明
com_print_typeinfo(object $comobject[,string $dispinterface=NULL
[,bool $wantsink= FALSE
]]): boolThe purpose of this function is to help generate a skeleton class for use as an event sink. You may also use it to generate a dump of any COM object, provided that it supports enough of the introspection interfaces, and that you know the name of the interface you want to display.
参数
$comobject$comobjectshould be either an instance of a COM object, or be the name of a typelibrary(which will be resolved according to the rules set out in com_load_typelib()).
$dispinterfaceThe name of anIDispatchdescendant interface that you want to display.
$wantsink If set to TRUE
, the corresponding sink interface will be displayed instead.
返回值
成功时返回TRUE
,或者在失败时返回FALSE
。
参见
com_event_sink()
Connect events from a COM object to a PHP objectcom_load_typelib()
装载一个 Typelib
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: 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: 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: Csaba Gabor from Vienna
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
鹏仔微信 15129739599 鹏仔QQ344225443 鹏仔前端 pjxi.com 共享博客 sharedbk.com
图片声明:本站部分配图来自网络。本站只作为美观性配图使用,无任何非法侵犯第三方意图,一切解释权归图片著作权方,本站不承担任何责任。如有恶意碰瓷者,必当奉陪到底严惩不贷!