Jump to content

Gnarly parameter problem!


smiggles

Recommended Posts

Hi everyone,

 

This one seems to be a bit gnarly!

 

I want to call a COM function that has the following definition in IDL:

       

        /* DISPID=37 */

        /* VT_I4 [3] */

        function Connect(

                /* VT_VARIANT [12] [in] */ $SecurityToken,

                /* VT_BSTR [8] [in] */ $Workstation,

                /* VT_BSTR [8] [in] */ $Context,

                /* VT_PTR [26] [out] --> VT_PTR [26]  */ &$Connection

                )

        {

                /* method Connect */

        }

 

As you can see the 4th parameter is defined as an OUT only parameter.

 

This out parameter is actually another com object that the server creates and returns to me - its a 'AccServer.SAConnection' COM object.

 

If I pre-create an object and pass it as the fourth parameter - like this:

 

$connection = new COM("AccServer.SAConnection");

 

and then call the function:

 

        $failurecode=$server->Connect($token,"PHPScript",$v5[0],$connection);

 

the code executes fine -but the returned object ($connection) is still the empty one that I passed in rather than the one that should have been created and returned.

 

I've tried passing by the object by reference (&) but this makes no difference.

 

Can anybody tell me what the correct syntax is?

 

Thanks in advance...

 

Paul

Link to comment
https://forums.phpfreaks.com/topic/79439-gnarly-parameter-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.