Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- can't get return value from COM in PHP5
November 8, 2005, 9:56 pm
rate this thread
have in a COM+ DLL.
I have the following code snippet:
STDMETHOD(add)(long num1, long num2, long* result);
STDMETHODIMP CsampleApp::add(long num1, long num2, long *result)
*result = num1 + num2;
I wrote a PHP script to invoke this method. It can't get the new value
from this function.
echo "Call Com Object<br>";
$instance = new COM("sampleApp.SimpleCom");
$instance ->test(1, 2, $returnValue);
echo "Return should be: " . $returnValue;
I am getting $returnValue = 0 instead of 3.
I have tried using Variants but that is not going well. I am hoping
someone may be able to assist me.
Thank you in advance.
Re: can't get return value from COM in PHP5
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?
- » Building PHP 5 with Apache2 on Windows XP with Visual C++ ExpressEdition 2005 Beta?
- — Previous thread in » PHP Scripting Forum
- » ssh on command line: force using a group size (prime size) of 1024 (and no...
- — The site's Newest Thread. Posted in » Secure Shell Forum