$dw = new COM("DynamicWrapper");
$dw->Register("EbUsbApi.dll", "EbCreateDataFile", 'i=sls', "f=s", "r=l"); 想问一下,这里的'i=sls', "f=s", "r=l"是什么意思
我是PHP小白,因为最近有个项目要用到PHP调用dll,正在学习。
这段是我看到一篇总结PHP调用dll经验的文章里的。链接如下:
http://blog.csdn.net/hn3e21/article/details/6074847 求大神答疑解惑 感谢
$dw->Register("EbUsbApi.dll", "EbCreateDataFile", 'i=sls', "f=s", "r=l"); 想问一下,这里的'i=sls', "f=s", "r=l"是什么意思
我是PHP小白,因为最近有个项目要用到PHP调用dll,正在学习。
这段是我看到一篇总结PHP调用dll经验的文章里的。链接如下:
http://blog.csdn.net/hn3e21/article/details/6074847 求大神答疑解惑 感谢
i=describes the number and data type of the functions parametersf=type of call _stdcall or _cdecl. So it can work with both MS C++ and Borland C++. Default to _stdcall. If that doesn't work use _cdecl. If that doesn't work good luck!r=return data type.Data types are:const ARGTYPEINFO ArgInfo[] =
{
{'a', sizeof(IDispatch*), VT_DISPATCH}, // a IDispatch*
{'c', sizeof(unsigned char), VT_I4}, // c signed char
{'d', sizeof(double), VT_R8}, // d 8 byte real
{'f', sizeof(float), VT_R4}, // f 4 byte real
{'k', sizeof(IUnknown*), VT_UNKNOWN}, // k IUnknown*
{'h', sizeof(long), VT_I4}, // h HANDLE
{'l', sizeof(long), VT_I4}, // l long
{'p', sizeof(void*), VT_PTR}, // p pointer
{'s', sizeof(BSTR), VT_LPSTR}, // s string
{'t', sizeof(short), VT_I2}, // t short
{'u', sizeof(UINT), VT_UINT}, // u unsigned int
{'w', sizeof(BSTR), VT_LPWSTR}, // w wide string
}
谢谢!我这还有个问题,
我写了一段代码,运行的时候为什么会出现下面的错误啊。
Fatal error: Call to undefined function newCOM() newCOM这个函数要怎么用涉及到调用dll的代码是这样<?php
$dw=newCOM("DynamicWrapper");
$dw->Register("sDLL.dll","plus","f=s","i=ll","r=l");
$no3=plus(2,2);
?>
$dw = new COM("DynamicWrapper");
打了空格就会提示 class 未定义
如果你的 php 版本大于 5.3 还需要加载对应扩展
php.ini
extension=php_com_dotnet.dll
哦哦 这样啊 谢谢不过 为什么运行起来又会报其他错误呢错误如下: Fatal error: Uncaught exception 'com_exception' with message 'Failed to create COM object `DynamicWrapper.dll'
现在报的错是这个了 message后面没有话了 知道怎么回事么
Fatal error: Uncaught exception 'com_exception' with message '
php5 之后dl()已经被废了 不可以了
现在报的错是这个了 message后面没有话了 知道怎么回事么
Fatal error: Uncaught exception 'com_exception' with message '