Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    New Coder
    Join Date
    Aug 2008
    Location
    India
    Posts
    88
    Thanks
    3
    Thanked 0 Times in 0 Posts

    data-types from COM Dll

    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.
    In love with PHP,Mysql & Javascript

  • #2
    Senior Coder
    Join Date
    Jul 2011
    Posts
    1,226
    Thanks
    3
    Thanked 171 Times in 171 Posts
    Quote Originally Posted by satish_j View Post
    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?
    Useful function to retrieve difference in times
    The best PHP resource
    A good PHP FAQ
    PLEASE remember to wrap your code in [PHP] tags.
    PHP Code:
    // Replace this
    if(isset($_POST['submitButton']))
    // With this
    if(!empty($_POST))
    // Then check for values/forms. Some IE versions don't send the submit button 
    Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.

  • #3
    New Coder
    Join Date
    Aug 2008
    Location
    India
    Posts
    88
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by BluePanther View Post
    How are you trying to use them in PHP? And what exactly is the purpose of this project?
    iam using COM object as follows:
    Code:
    $obj=new COM(DLLName.className);
    $pm1="param1";
    $pm2="";
    $pm3="";
    $obj->funcName($pm1,$pm2,$pm3);
    In love with PHP,Mysql & Javascript

  • #4
    Senior Coder
    Join Date
    Jul 2011
    Posts
    1,226
    Thanks
    3
    Thanked 171 Times in 171 Posts
    Quote Originally Posted by satish_j View Post
    iam using COM object as follows:
    Code:
    $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.
    Useful function to retrieve difference in times
    The best PHP resource
    A good PHP FAQ
    PLEASE remember to wrap your code in [PHP] tags.
    PHP Code:
    // Replace this
    if(isset($_POST['submitButton']))
    // With this
    if(!empty($_POST))
    // Then check for values/forms. Some IE versions don't send the submit button 
    Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.

  • #5
    New Coder
    Join Date
    Aug 2008
    Location
    India
    Posts
    88
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by BluePanther View Post
    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..
    In love with PHP,Mysql & Javascript

  • #6
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    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.

  • #7
    New Coder
    Join Date
    Aug 2008
    Location
    India
    Posts
    88
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Fou-Lu View Post
    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.
    In love with PHP,Mysql & Javascript

  • #8
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    Quote Originally Posted by satish_j View Post
    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).

  • #9
    New Coder
    Join Date
    Aug 2008
    Location
    India
    Posts
    88
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Fou-Lu View Post
    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
    In love with PHP,Mysql & Javascript


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •