doctorfish Posted February 28, 2006 Share Posted February 28, 2006 Hi.I'm trying to access a dll on a Windows XP system. (PHP 4.3,4.4, and 5.05) The com object is created fine but the when I call a function in the object I get the following error.Fatal error: Uncaught exception 'com_exception' with message 'Parameter 1: Type mismatch. ' in W:\www\comtests\whoareyou.php:12 Stack trace: #0 W:\www\comtests\whoareyou.php(12): com->Load(Object(variant), Object(variant)) #1 W:\www\comtests\whoareyou.php(24): LoadClient('') #2 {main} thrown in W:\www\comtests\whoareyou.php on line 12Here's the code:[code]function LoadClient($uid){ $UserID = new VARIANT($uid); $d=0; $ID = new VARIANT($d); $objClient = new COM("ClientMTS.ProfileHdr") or die("Cannot create ClientMTS object."); $objClient->Load($ID,$UserID); // this is line 12 $profID=trim($objClient->ProfID); $fname=trim($objClient->FirstName); $lname=trim($objClient->LastName); unset($objClient); return array($profID,$fname,$lname);}[/code]If I set the variables within the function call I get this error:Fatal error: Cannot pass parameter 1 by reference in W:\www\comtests\com_return.php on line 12And changing to PHP 5.1.1 with an xampp install gave me this:PHP Uncaught exception 'com_exception' with message 'Error [0x80020003] Member not foundThis is the first time I've tried to access a dll with COM and I don't know VB (it's a visual basic dll). The VB developer doesn't know PHP but the dll in question does work when called from other VB programs. The dll is registered with the system but this is not the issue as the object is created but craps out when I call the Load function on line 12.I've been searching onlione for about 4 hours all to no avail so I'm open to any and all suggestions. I don't have access to the VB code at this moment but can probably post it here later if need be.Thanks.Dave Quote Link to comment https://forums.phpfreaks.com/topic/3780-windows-dll-type-mismatch/ Share on other sites More sharing options...
doctorfish Posted March 2, 2006 Author Share Posted March 2, 2006 I'm still running in circles in this one.Anyone using PHP on Windows and having any kind of similar issues?Anyone know of any sites where I can get more info on using COM objects with PHP. Many sites I've found give a brief description of how to do it but don't offer any advice for what to do when things don't work.Any help or a point in the right direction is appreciated.Thanks.Dave Quote Link to comment https://forums.phpfreaks.com/topic/3780-windows-dll-type-mismatch/#findComment-13558 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.