Re: COM - accessing pointer variables
| From: | Alain Samoun | Date: | Wed, 19 Sep 2001 19:12:37 +0000 |
| Subject: | Re: COM - accessing pointer variables | ||
| References: | 1 2 3 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-9416@lists.php.net to get a copy of this message | ||
I'm not sure, but try:
$str = new VARIANT($obj->Get_Version_Str() , VT_STR | VT_BYREF );
or simply:
$str = $obj->Get_Version_Str();
Also, are you sure that release() is part of your object definition?
> $obj->Release();
Alain
On Wed, Sep 19, 2001 at 08:50:52AM +0100, park wrote:
> Im afraid I dont know VB script so I cant tell you, to call it from C you
> would use:
>
> ITest *ptr = CoCreateObject( CLSID_Test...... )
>
> char str[ 1024 ];
> ITest->Get_Version_Str( str, sizeof( str ) );
>
> // str contains the version string
>
> ITest->Release();
>
>
> Last night I looked through the php source code and am pretty shure it needs
> calling something like
>
> $obj = new COM( "Test.test" );
> $str = new VARIANT( "a very long string, so that sizeof string can handle
> returned string, is there a better way ?", VT_STR | VT_BYREF );
>
> $obj->Get_Version_Str( $str );
> $obj->Release();
>
> Unfortunatly, whenever I try creating a variable of type VARIANT ( even if
> its just )
> $o = new VARIANT();
> My script hangs, forever!!!
>
> Also I cant call Release - Its a member of IUnknown so I thought I would be
> able to ?
>
>
> All help will be apreciated.
>
> Park
>
>
>
> "Alain Samoun" <alain@samoun.com> wrote in message
> news:NDBBKDPANIGMPIPILNBBEEKLDAAA.alain@samoun.com...
> > Do you have a VB script showing how it connects to your COM object?
> > Alain
> >
> >
> > -----Original Message-----
> > From: park [mailto:park99@freenet.co.uk]
> > Sent: Tuesday, September 18, 2001 3:18 AM
> > To: php-windows@lists.php.net
> > Subject: [PHP-WIN] COM - accessing pointer variables
> >
> >
> > I have a method into my COM object specified as:
> >
> > HRESULT Get_Version_Str( [ in, out, size_is( size ) ] unsigned char *str,
> > [ in ] unsigned long size );
> >
> > now how do I call this from PHP ?
> > I think that I need to create the arg's as VARIANT but I cant get it to
> work
> > :(
> >
> > please help
> >
> > park
> >
> >
> >
> >
> >
> > --
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net
> > For additional commands, e-mail: php-windows-help@lists.php.net
> > To contact the list administrators, e-mail: php-list-admin@lists.php.net
> >
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net
> For additional commands, e-mail: php-windows-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net