[2001-07-05 20:43:44] [EMAIL PROTECTED]

but by definition every interface derived from IDispatch that should support
references
must expect VARIANT *var instead of <anothertype> *var . am i wrong ?
[2001-07-23 13:50:06] [EMAIL PROTECTED]

doesn't work with VBScript either and due to the provided typelib i assume
that it is a
user (component) error.

-harald.

Ive played around with this, and can tell you that a IDispatch interface can
have ( pass by ref ) args that are of any type ( BSTR *, long *, etc ).
These can be accesed without using a typelib from both VBScript and Perl but
not php.

For example, given an interface like this

HRESULT test( [ out, ref ] unsigned char *n );

I can call that from PERL like

use Win32::OLE;
use Win32::OLE::Variant;

$obj = Win32::OLE->new( "comobjectname" );
$n = Variant( VT_UI1 | VT_BYREF, 0 );
$obj->test( $n );

and in VBScript its called like this

var obj = Server.CreateObject( "comobjectname" )
var n = 0
obj.test( n )

you dont need to have 'n' defined as a VARIANT, as in VBScript ALL variables
are VARIANT's.
Note that both these DONT use a typelib.

Given that you would expect this to work in php

$obj = new COM( "comobjectname" );
$n = new VARIANT( 0, VT_UI1 | VT_BYREF );
$obj->test( $n );

But you get this error:
Warning: Invoke() failed: Type mismatch in <filename> on line <line>

I understand from what Ive read that if the interface was defined with the
arg as type VARIANT *, it would work.....

BUT if you wish to be able to support existing interfaces ( which dont use
type VARIANT * ) and to provide the same 'level' of COM support as VBScript
and Perl.  You should be able to call the above interface with the ( above )
php code.

Rich

P.S. when is php 4.0.7 due out ?




-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to