用dynamicwrapper方法调用。下载dynamicwrapper.dll到php ext下与windows system32下,
$dw = new com(dynamicwrapper);
$dw->register(ebusbapi.dll, ebcreatedatafile, 'i=sls', f=s, r=l);
$ch = $dw->ebcreatedatafile(222,11,22);
i=describes the number and data type of the functions parameters
f=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
}
[b]
请教返回值为布尔类型应该选哪个?[/b]
