...

View Full Version : data-types from COM Dll



satish_j
01-31-2012, 07:23 AM
have a COM Dll which returns output of 'Long' and 'Byte' data-types from one of its functions.
Can PHP handle these data-type?
PS: have already tried using it..it gives me 'Parameter :Type Mismatch' error.

BluePanther
01-31-2012, 07:48 AM
have a COM Dll which returns output of 'Long' and 'Byte' data-types from one of its functions.
Can PHP handle these data-type?
PS: have already tried using it..it gives me 'Parameter :Type Mismatch' error.

How are you trying to use them in PHP? And what exactly is the purpose of this project?

satish_j
01-31-2012, 07:56 AM
How are you trying to use them in PHP? And what exactly is the purpose of this project?
iam using COM object as follows:


$obj=new COM(DLLName.className);
$pm1="param1";
$pm2="";
$pm3="";
$obj->funcName($pm1,$pm2,$pm3);

BluePanther
01-31-2012, 09:05 AM
iam using COM object as follows:


$obj=new COM(DLLName.className);
$pm1="param1";
$pm2="";
$pm3="";
$obj->funcName($pm1,$pm2,$pm3);


If $pm2 and $pm3 are optional, you should provide no value for them at all. If they're not, you need to supply the correct parameters. I think this is where the problem is.

satish_j
01-31-2012, 09:13 AM
If $pm2 and $pm3 are optional, you should provide no value for them at all. If they're not, you need to supply the correct parameters. I think this is where the problem is.

Both of these parameters are the outputs recd from function..

Fou-Lu
01-31-2012, 02:21 PM
I'm not sure how PHP will handle the result of the long; I know variant includes a 64-bit double, but doesn't appear to have a long. It may return a string or a binary string to represent it. Just got to try it and dump it to see what you get.
As for your error itself, it appears to me that its complaining about the string to long conversion. Since you don't need to use variant anymore, give it a 0 not an empty string.

satish_j
02-01-2012, 10:33 AM
I'm not sure how PHP will handle the result of the long; I know variant includes a 64-bit double, but doesn't appear to have a long. It may return a string or a binary string to represent it. Just got to try it and dump it to see what you get.
As for your error itself, it appears to me that its complaining about the string to long conversion. Since you don't need to use variant anymore, give it a 0 not an empty string.

No success,still getting 'ncaught exception 'com_exception' with message 'Parameter 0: Type mismatch' even after using 0.

Fou-Lu
02-01-2012, 03:33 PM
No success,still getting 'ncaught exception 'com_exception' with message 'Parameter 0: Type mismatch' even after using 0.

What is the signature for the function you are trying to call? This one says parameter 0 is mismatched, which I guess is indicating the first parameter (although I find it unusual that it would start at 0 based).

satish_j
02-07-2012, 11:05 AM
What is the signature for the function you are trying to call? This one says parameter 0 is mismatched, which I guess is indicating the first parameter (although I find it unusual that it would start at 0 based).

The function iam rying to call is:
funcname($ip1,$ip2,$ip3,$op1,$op2)
$ip1,2,3 are the inputs (all string)
$op1,2 are the outputs.
$op1-->long
$op2-->byte



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum