如何使用 OLE_COLOR 作为参数从 PHP 调用 COM 函数?
我正在尝试使用 COM 互操作扩展从 PHP 调用 COM 对象。 一个函数需要 OLE_COLOR 作为参数? 有什么方法可以从 PHP 传递这种值吗?
我尝试传递一个简单的整数值但没有成功。
$this->oBuilder->Font->Color = 255;
I am trying to call a COM object from PHP using the COM interop extension. One function requires an OLE_COLOR as an argument? Is there any way to pass this kind of value from PHP?
I have tried passing a simple integer value with no success.
$this->oBuilder->Font->Color = 255;
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
PHP 可以自动定义 COM 公开的常量。
set_ini('com.autoregister-typelib ', 真的);
或手动
com_load_typelib($typelib_name);
但如果 OLE_COLOR 是一个对象而不是整数、字符串或其他基元
使用常量(或整数)将不起作用。
或者类似的东西会。
PHP can define the constants the COM exposes automatic.
set_ini('com.autoregister-typelib', true);
or by hand
com_load_typelib($typelib_name);
But if the OLE_COLOR is a object instead of an integer, string or other primitive
using constants (or integers) won't work.
Or something similar will.
当我从 PHP 调用 COM 函数时,我只是在调用中传递它们。 所以我的旧代码有:
When I've called COM functions from PHP, I just passed them in the call. So my old code has: