|
Posted by Steve on 11/09/30 11:31
> I am running into problems obtaining the return value of a method I
> have in a COM+ DLL.
> STDMETHOD(add)(long num1, long num2, long* result);
>
> STDMETHODIMP CsampleApp::add(long num1, long num2, long *result)
> {
> *result = num1 + num2;
>
> return S_OK;
> }
> I wrote a PHP script to invoke this method. It can't get the new value
> from this function.
> <?php
> echo "Call Com Object<br>";
> $instance = new COM("sampleApp.SimpleCom");
> $instance ->test(1, 2, $returnValue);
> echo "Return should be: " . $returnValue;
> $instance->release();
> ?>
> I am getting $returnValue = 0 instead of 3.
Could it be because... the method name in your COM component is "add"
but you are calling a method "test" in your PHP instance? Or possibly
because you need to pass $returnValue by reference (ie &$returnValue)
because it's supposed to be a pointer? Or maybe both?
---
Steve
[Back to original message]
|