#28179 [Opn->WFx]: [COM] passing classes as a parameter
| From: | wez@php.net | Date: | Wed, 28 Apr 2004 15:12:43 +0000 |
| Subject: | #28179 [Opn->WFx]: [COM] passing classes as a parameter | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-58950@lists.php.net to get a copy of this message | ||
ID: 28179
Updated by: wez@php.net
Reported By: arnout at argeweb dot nl
-Status: Open
+Status: Wont fix
Bug Type: COM related
Operating System: Windows NT 5.2 / Windows 2003
PHP Version: 4.3.6
New Comment:
Maybe its about time I read the version field of this report.
This problem won't be fixed in PHP 4, but already works just fine in
PHP 5.
Previous Comments:
------------------------------------------------------------------------
[2004-04-28 13:30:39] arnout at argeweb dot nl
I received the DLL and the error's still there.
http://www.argeweb.nl/php/PHPTest.zip
This file contains the DLL, the sourcecodes, an example and a readme.
No IDL but I think this might be even better.
------------------------------------------------------------------------
[2004-04-28 11:11:39] wez@php.net
The IDL describes what the method looks like to other COM applications;
I need it to see what their object expects and help deduce what might
be going wrong.
------------------------------------------------------------------------
[2004-04-28 09:39:46] arnout at argeweb dot nl
I've talked to them. They said an IDL wouldn't do much good because IDL
doesn't contain friend functions, only publics.
They offered to create a sober "Hello world" DLL in VB which simulates
the case. I'll test again when I get it. If the error occurs again I'll
send you the source code + compiled version.
Is that of use to you?
------------------------------------------------------------------------
[2004-04-27 19:52:30] wez@php.net
It could easily be a PHP problem.
Could you paste the IDL for the method in question here please, so that
I can make a similar COM object here to
test against.
If you're unsure about how to get it, ask the people
that made the DLL.
------------------------------------------------------------------------
[2004-04-27 12:02:31] arnout at argeweb dot nl
Description:
------------
I'm trying to pass a COM class into a member function of another COM
class object. The second object chokes.
One class is the connection with the database.
The second is something that needs to connect.
Reproduce code:
---------------
$Conn = new COM("some.Conn");
$Conn->Connect( 'database', 'user', 'pass');
// this object is works fine.
$Customer = new COM("some.Customer");
$Customer->Connect( $Conn ); // KLABAM!
Expected result:
----------------
I'd expect the $Customer->Connect() function to accept the $Conn as
being a "Conn" object and just connect.
Actual result:
--------------
"Error number: 97
Error description: Can not call friend function on object which is not
an instance of defining class"
This error comes from the object.
The Customer->Connect function calls a friend function to do something
with the Conn object. This function does not believe the object is a
living Conn object and spittes it out.
The whole thing works perfectly in C, VC++, VB, Jscript, VBscript (ASP)
and Delphi.
I've called the company that made the DLL, and they think the Conn
object I pass isn't a real Conn object, but a simulation / emulation.
Or a "COM" object of course.
I've tried converting it to a more MS-like thing with the VARIANT
class, but it doesn't seem to do much good. (type mismatch)
So is this a PHP problem, or didn't the ones who made the DLL read the
COM specifications too well?
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=28179&edit=1