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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.