php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #40581 Pass Struct type to COM object from PHP
Submitted: 2007-02-21 17:29 UTC Modified: 2020-02-08 14:14 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: elvir at innvue dot com Assigned:
Status: Open Package: COM related
PHP Version: 5.2.1 OS: Windows Server 2003
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: elvir at innvue dot com
New email:
PHP Version: OS:

 

 [2007-02-21 17:29 UTC] 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.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-02-21 17:40 UTC] elvir at innvue dot com
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.
 [2007-08-15 08:36 UTC] jani@php.net
Assigned to the maintainer.
 [2007-08-16 07:40 UTC] pajoye@php.net
Assign to the active maintainer.
 [2017-10-24 03:32 UTC] kalle@php.net
-Status: Assigned +Status: Open -Assigned To: wharmby +Assigned To:
 [2020-02-08 14:14 UTC] cmb@php.net
-Type: Bug +Type: Feature/Change Request
 [2020-02-08 14:14 UTC] cmb@php.net
> how can i create a struct (c++) type in php to pass to COM.

You can't, because VT_RECORD is not yet supported by the
com_dotnet extension.  Re-categorizing as feature request.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 13:01:29 2024 UTC