#40581 [NEW]: Pass Struct type to COM object from PHP

Ask a Question related to PHP Bugs, Design and Development.

  1. #1

    Default #40581 [NEW]: Pass Struct type to COM object from PHP

    From: elvir at innvue dot com
    Operating system: Windows Server 2003
    PHP version: 5.2.1
    PHP Bug Type: COM related
    Bug description: Pass Struct type to COM object from PHP

    Description:
    ------------
    hello,
    I have a COM object created in c++. One of methods accept a struct as a
    parameter. I have to call this method from PHP script.


    Reproduce code:
    ---------------
    object accepted:
    typedef [uuid(5A0CB3A7-798A-42ff-B864-F8D90B55DB7C)] struct mystruct
    {
    LPSTR var1;
    LPSTR var2;
    LPSTR var3;
    LPSTR var4;
    } mystruct

    $newCom = new COM("classname.methodname") or die (" COM exeption");

    if(method_exists ($newCom, "ResetS"))
    // this retun true






    Expected result:
    ----------------
    what i want is:
    call my method with the following param from php:

    $newCom->mymethod(mystruct sructPHP, GUID sku);

    Please can you help me?

    Actual result:
    --------------
    I tryed to create an object in PHP and call method i get the following
    error:
    'com_exception' with message 'Error [0x80028019] Old format or invalid
    type library.

    --
    Edit bug report at [url]http://bugs.php.net/?id=40581&edit=1[/url]
    --
    Try a CVS snapshot (PHP 4.4): [url]http://bugs.php.net/fix.php?id=40581&r=trysnapshot44[/url]
    Try a CVS snapshot (PHP 5.2): [url]http://bugs.php.net/fix.php?id=40581&r=trysnapshot52[/url]
    Try a CVS snapshot (PHP 6.0): [url]http://bugs.php.net/fix.php?id=40581&r=trysnapshot60[/url]
    Fixed in CVS: [url]http://bugs.php.net/fix.php?id=40581&r=fixedcvs[/url]
    Fixed in release: [url]http://bugs.php.net/fix.php?id=40581&r=alreadyfixed[/url]
    Need backtrace: [url]http://bugs.php.net/fix.php?id=40581&r=needtrace[/url]
    Need Reproduce Script: [url]http://bugs.php.net/fix.php?id=40581&r=needscript[/url]
    Try newer version: [url]http://bugs.php.net/fix.php?id=40581&r=oldversion[/url]
    Not developer issue: [url]http://bugs.php.net/fix.php?id=40581&r=support[/url]
    Expected behavior: [url]http://bugs.php.net/fix.php?id=40581&r=notwrong[/url]
    Not enough info: [url]http://bugs.php.net/fix.php?id=40581&r=notenoughinfo[/url]
    Submitted twice: [url]http://bugs.php.net/fix.php?id=40581&r=submittedtwice[/url]
    register_globals: [url]http://bugs.php.net/fix.php?id=40581&r=globals[/url]
    PHP 3 support discontinued: [url]http://bugs.php.net/fix.php?id=40581&r=php3[/url]
    Daylight Savings: [url]http://bugs.php.net/fix.php?id=40581&r=dst[/url]
    IIS Stability: [url]http://bugs.php.net/fix.php?id=40581&r=isapi[/url]
    Install GNU Sed: [url]http://bugs.php.net/fix.php?id=40581&r=gnused[/url]
    Floating point limitations: [url]http://bugs.php.net/fix.php?id=40581&r=float[/url]
    No Zend Extensions: [url]http://bugs.php.net/fix.php?id=40581&r=nozend[/url]
    MySQL Configuration Error: [url]http://bugs.php.net/fix.php?id=40581&r=mysqlcfg[/url]
    elvir at innvue dot com Guest

  2. Similar Questions and Discussions

    1. Cannot serialize object of type System.Object[,]. Multidimensional arrays are not supported
      Hi, I get this on server when trying to retun a 2 dim array. I apprecaite that they are not supported as per...
    2. Issues with declaring struct arrays inside of a struct
      I have the following C++ code: define MAXXPAXX 64 // Pack sub component of database struct. typedef PREFIX_PACKED struct { DWORD packid;...
    3. Calling fun taking struct and not pointer to struct?
      Robert Feldt wrote: I'm a little confused by the question... are you asking if: 1) The act of using a struct in the declaration of another...
    4. Fwd: Calling fun taking struct and not pointer to struct?
      Related to the recent thread about nested structs and Ruby/DL here is the answer from Ruby/DL's author: So that's what I ask you: Is inlining...
    5. #25419 [NEW]: Call-time pass-by-reference has been deprecated but without it it's impossible to pass a object-reference via call_user_function
      From: roland at inkoeln dot com Operating system: Linux PHP version: 4.3.3 PHP Bug Type: Variables related Bug description: ...
  3. #2

    Default #40581 [Opn->Fbk]: Pass Struct type to COM object from PHP

    ID: 40581
    Updated by: [email]tony2001@php.net[/email]
    Reported By: elvir at innvue dot com
    -Status: Open
    +Status: Feedback
    Bug Type: COM related
    Operating System: Windows Server 2003
    PHP Version: 5.2.1
    New Comment:

    Thank you for this bug report. To properly diagnose the problem, we
    need a short but complete example script to be able to reproduce
    this bug ourselves.

    A proper reproducing script starts with <?php and ends with ?>,
    is max. 10-20 lines long and does not require any external
    resources such as databases, etc. If the script requires a
    database to demonstrate the issue, please make sure it creates
    all necessary tables, stored procedures etc.

    Please avoid embedding huge scripts into the report.




    Previous Comments:
    ------------------------------------------------------------------------

    [2007-02-21 17:29:27] elvir at innvue dot com

    Description:
    ------------
    hello,
    I have a COM object created in c++. One of methods accept a struct as a
    parameter. I have to call this method from PHP script.


    Reproduce code:
    ---------------
    object accepted:
    typedef [uuid(5A0CB3A7-798A-42ff-B864-F8D90B55DB7C)] struct mystruct
    {
    LPSTR var1;
    LPSTR var2;
    LPSTR var3;
    LPSTR var4;
    } mystruct

    $newCom = new COM("classname.methodname") or die (" COM exeption");

    if(method_exists ($newCom, "ResetS"))
    // this retun true






    Expected result:
    ----------------
    what i want is:
    call my method with the following param from php:

    $newCom->mymethod(mystruct sructPHP, GUID sku);

    Please can you help me?

    Actual result:
    --------------
    I tryed to create an object in PHP and call method i get the following
    error:
    'com_exception' with message 'Error [0x80028019] Old format or invalid
    type library.


    ------------------------------------------------------------------------


    --
    Edit this bug report at [url]http://bugs.php.net/?id=40581&edit=1[/url]
    tony2001@php.net Guest

  4. #3

    Default #40581 [Fbk->Opn]: Pass Struct type to COM object from PHP

    ID: 40581
    User updated by: elvir at innvue dot com
    Reported By: elvir at innvue dot com
    -Status: Feedback
    +Status: Open
    Bug Type: COM related
    Operating System: Windows Server 2003
    PHP Version: 5.2.1
    New Comment:

    c++ codes:

    typedef [uuid(5A0CB3A7-798A-42ff-B864-F8D90B55DB7C)] struct mystruct
    {
    LPSTR var1;
    LPSTR var2;
    LPSTR var3;
    LPSTR var4;
    } mystruct


    <?php

    $newCom = new COM("classname.methodname") or die (" COM exeption");

    if(method_exists ($newCom, "ResetS")){
    echo "method exists ...";
    $newCom->ResetS(struct, GUID);
    }else{
    echo "method doesn't exist...";
    }


    ?>

    Question is: how can i create a struct (c++) type in php to pass to
    COM.


    Previous Comments:
    ------------------------------------------------------------------------

    [2007-02-21 17:33:32] [email]tony2001@php.net[/email]

    Thank you for this bug report. To properly diagnose the problem, we
    need a short but complete example script to be able to reproduce
    this bug ourselves.

    A proper reproducing script starts with <?php and ends with ?>,
    is max. 10-20 lines long and does not require any external
    resources such as databases, etc. If the script requires a
    database to demonstrate the issue, please make sure it creates
    all necessary tables, stored procedures etc.

    Please avoid embedding huge scripts into the report.



    ------------------------------------------------------------------------

    [2007-02-21 17:29:27] elvir at innvue dot com

    Description:
    ------------
    hello,
    I have a COM object created in c++. One of methods accept a struct as a
    parameter. I have to call this method from PHP script.


    Reproduce code:
    ---------------
    object accepted:
    typedef [uuid(5A0CB3A7-798A-42ff-B864-F8D90B55DB7C)] struct mystruct
    {
    LPSTR var1;
    LPSTR var2;
    LPSTR var3;
    LPSTR var4;
    } mystruct

    $newCom = new COM("classname.methodname") or die (" COM exeption");

    if(method_exists ($newCom, "ResetS"))
    // this retun true






    Expected result:
    ----------------
    what i want is:
    call my method with the following param from php:

    $newCom->mymethod(mystruct sructPHP, GUID sku);

    Please can you help me?

    Actual result:
    --------------
    I tryed to create an object in PHP and call method i get the following
    error:
    'com_exception' with message 'Error [0x80028019] Old format or invalid
    type library.


    ------------------------------------------------------------------------


    --
    Edit this bug report at [url]http://bugs.php.net/?id=40581&edit=1[/url]
    elvir at innvue dot com Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139