ID: 28179 Updated by: [EMAIL PROTECTED] Reported By: arnout at argeweb dot nl -Status: Open +Status: Feedback Bug Type: COM related Operating System: Windows NT 5.2 / Windows 2003 PHP Version: 4.3.6 New Comment:
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. Previous Comments: ------------------------------------------------------------------------ [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