Re: COM problem: help
| From: | Harald Radi | Date: | Sun, 23 Sep 2001 10:49:19 +0000 |
| Subject: | Re: COM problem: help | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-66383@lists.php.net to get a copy of this message | ||
hi crawley,
please submit a bug report next time, i check them more recently than
the mailinglist.
'it doesn't work' is also a poor description of the problem. looking to
your interface definition
i think the problem is, that you have to specify these values as
VARIANT* because you can't pass
them by reference otherwise.
there is already a bugreport refering to this (i can't remember the id),
search for it if you need more
infos ..
-harald.
"Crawley" <crawley.storm@ntlworld.com> schrieb im Newsbeitrag
news:<20010919205759.10730.qmail@pb1.pair.com>...
> I have an interface like this:
>
> interface ITest
> {
> HRESULT foo( [ out ] int *n );
> HRESULT bar( [ out, string ] char *str );
> };
>
> I can call the first one from PH, but ONLY if I make the variable 'n'
> of type [ out, retval ]. My understanding is that I should be able to
> call it like this.
>
> $obj = new COM( "mycomobject.test" );
> $n = new VARIANT( 0, VT_UI1 | VT_BYREF );
>
> $obj->foo( $n );
>
> but when I try this, it dosent work
>
> What am I missing ?
>
> asuming I'm missing something, can I do the same thing with a string.
> What I want to do is pass strings back from my COM object. I read
> that there is no support for VARIANT arrays, but I see you support
> VT_BSTR. So can I have strings as out params.
>
> If not I'm going to have to move to another scripting language ( for
> this project ). Aside from that -
>
> PHP is great, its like scripting C++ ... so the best of both worlds.
>
> Rich
>
>