473,325 Members | 2,771 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

can't get return value from COM in PHP5

I am running into problems obtaining the return value of a method I
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;

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.

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.
Kelvin

Nov 8 '05 #1
2 1420
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

Nov 9 '05 #2
Hi Steve,

Thanks for replying. The method name difference is a typo on my part.
Sorry about that.

I tried passing $returnValue by reference but the value is still 0
instead of 3.

Thanks,
Kelvin

Nov 9 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Rob Ristroph | last post by:
I have tried out PHP 5 for the first time (with assistance from this group -- thanks!). The people I was working with have a site that uses lots of php objects. They are having problems with...
0
by: Berislav Lopac | last post by:
Has anyone thought of developing a library aimed for PHP4 which would give the kind of functionality that PHP5 has when it comes to working with XML...
1
by: Pedro Fonseca | last post by:
Greetings everyone! I'm porting my applications to PHP5 and I've stumbled on yet another problem. I'll try to simplify things a bit. I have a main script that is being executed (index.php, PHP5...
2
by: burdeen | last post by:
I've been trying to return an array with PHP5 soap. Is this not supported? or am i doing it wrong? Seems to return on the last element in the array. In my WSDL i've defined my return type as a...
1
by: dk_sz | last post by:
Is it just me... Or is PHP5 XML very limited? Or am I missing something very obvious? Any way to use PHP4 Dom XML in PHP5? Does anyone know why support for it was dropped? I have following...
0
by: cty | last post by:
Title: Problem in session using php5 Good day, I use php5+mySQL4+IIS5.x Previuosly i use php4 and no error occur,
7
cassbiz
by: cassbiz | last post by:
the below script worked without any errors before I upgraded to php5 <?php include "cust_logged_in.php"; ?> <script type="text/javascript"> <!-- ...
1
by: michael.schmitz | last post by:
Hello all, I started porting a huge PHP application to PHP5 and encountered a problem with references. I don't know whether the behavior I see is a bug or a feature. The following nonsens test...
8
by: FFMG | last post by:
Hi, I am slowly moving my code to php5. But I would like to make it backward compatible in case something bad happens, (and to make sure I understand what the changes are). The way the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.