problem usign COM object

problem usign COM object

am 19.07.2007 22:26:51 von Jason McKnight

I am using a COM object from one of our system venders and I am having
problems using an in/out variable for one function on php 4.3.11. I can
load the COM interface, return the typeinfo and even call the function
successfully but I can't get a return value set for the variable. Here is
the code I am using:
$sessionid = (int) "";
$C1COM = com_load("ConceptCOM");
$val1 = $C1COM->OpenSession($sessionid);
echo "val1: "; print_r($val1); echo "
";
echo "session: "; print_r($sessionid); echo "
";

This prints:
val1: 1
session: 0

If I do the same thing using php 5 (just replace 'com_load' with 'new COM'),
I get the expected result with a valid sessionid. Here is the typeinfo for
the function:
/* DISPID=10 */
/* VT_I4 [3] */
function opensession(
/* VT_PTR [26] [in][out] --> VT_I4 [3] */ &$sessionid
)
{
}

I've tried different type casts, passing a variant, and different ways of
calling the method; is there anything that I need to do to handle a VT_PTR
type or a variable defined as in and out? Other then updating to php 5, can
php 4 handle setting a method parameter within a COM object? The vender is
willing to make some updates if needed but I don't want to have to do a
major rewrite.

Thanks!

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: problem usign COM object

am 19.07.2007 23:05:58 von Niel Archer

Hi
why not use:

new COM("ConceptCOM");

with PHP 4.3.11 as well?

the documentation for com_load says as much!
--
Niel Archer

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: problem usign COM object

am 20.07.2007 00:35:57 von Jason McKnight

For whatever reason when I use 'new COM' method and then try to load the
typeinfo I get this:
Warning: 23580072 is not a COM object handler in file.php on line 52


Thats probably a whole different problem all together; since I don't really
care about loading the typeinfo once its working I'll switch the php code to
the best method that will work after I get a solution to the original
problem. Both yield the same result when making the function call.
thanks anyways


"Niel Archer" wrote in message
news:20070719215948.8B16.SPAM-FREE@blueyonder.co.uk...
> Hi
> why not use:
>
> new COM("ConceptCOM");
>
> with PHP 4.3.11 as well?
>
> the documentation for com_load says as much!
> --
> Niel Archer

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php