您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

PHP调用C++DLL的问题

2024/5/17 5:30:39发布23次查看
用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=descri
用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]
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product