php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #49497 No ability to supply a userland PHP function as a callback for a COM method.
Submitted: 2009-09-08 08:59 UTC Modified: 2020-02-16 04:22 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: RQuadling at GMail dot com Assigned: cmb (profile)
Status: No Feedback Package: COM related
PHP Version: 5.3SVN-2009-09-08 (snap) OS: Windows XP SP3
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
43 - 22 = ?
Subscribe to this entry?

 
 [2009-09-08 08:59 UTC] RQuadling at GMail dot com
Description:
------------
Hi.

I think I'm pretty much on my own here, but here goes.

I'm evaluating a COM tool to allow me to OCR documents.

The COM object requires the registration of a callback to allow the 
object to send  results as it finds them (events in their terminology) 
back to a handler for processing (say logging in a DB, etc.).

According to their documentation, in C and VB, the registration is a 
trivial process of simply supplying the address of the function as the 
handler for the callback.

Obviously, this won't work in PHP as a PHP function isn't accessible 
like a compiled function from outside of PHP.

The "value" to be supplied is of type VT_I4. This is essentially just 
the address of the function (as I see things).


So, I think that a proxy is needed. Something to act in the middle of 
the PHP script and the callback invocation by the COM object.


Any ideas?



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-02-08 11:01 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2020-02-08 11:01 UTC] cmb@php.net
> The "value" to be supplied is of type VT_I4. This is essentially
> just the address of the function (as I see things).

That sounds a bit weird; I mean why storing a pointer as signed
integer?  I would rather expect that they use a VT_UI4, or more
likely a VT_PTR.  And actually, why would that API not accept a
VT_DISPATCH, and call a certain method on that?  The latter is
already supported by the COM extension, through `new
variant($php_obj);`.

Is it possible that the VT_I4 is supposed to be a DISPID?  Is that
documentation still publicly available?
 [2020-02-16 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Tue May 24 09:05:44 2022 UTC