Bug #49497 [Opn->Fbk]: No ability to supply a userland PHP function as a callback for a COM method.
| From: | cmb@php.net | Date: | Sat, 08 Feb 2020 11:01:30 +0000 |
| Subject: | Bug #49497 [Opn->Fbk]: No ability to supply a userland PHP function as a callback for a COM method. | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-225446@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=49497&edit=1
ID: 49497
Updated by: cmb@php.net
Reported by: RQuadling at GMail dot com
Summary: No ability to supply a userland PHP function as a
callback for a COM method.
-Status: Open
+Status: Feedback
Type: Bug
Package: COM related
Operating System: Windows XP SP3
PHP Version: 5.3SVN-2009-09-08 (snap)
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
> 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?
Previous Comments:
------------------------------------------------------------------------
[2009-09-08 08:59:42] 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?
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=49497&edit=1