动态库用DELPHI转化,高手们进
tint.dll是动态库,给出说明是:
//打开串口,
如 handle=tint_Open(“COM1”);
STDAPI tint_Open(BYTE *pCOM);
//关闭串口 tint.dll
STDAPI tint_Close(int ReaderHandle);
请问如何用delphi实现使用此函数?如下不正确
procedure tint_Open(); cdecl; external tint.dll';//打开
procedure tint_Close(); cdecl; external tint.dll'; //关闭
参数怎么放啊!
[解决办法]
function tint_Open(a:pchar):HWnd; cdecl; external tint.dll';//打开
procedure tint_Close(a:HWnd); cdecl; external tint.dll'; //关闭
我只是跟据你写的例子来写的,具体要看DLL说明文件,要不你把他DLL说明文件全部搞出来吧
[解决办法]
2L正解
如 handle=tint_Open(“COM1”);
第一个参数就是个字符串,用pchar即可
STDAPI tint_Open(BYTE *pCOM); 这个有点糊涂,是个byte指针,好像不是句柄,最好看看源码
另外cdecl不行试试stdcall
[解决办法]
function tint_Open(pCOM:PChar):HWnd; stdcall external 'tint.dll';
procedure tint_Close(ReaderHandle:HWnd); stdcall external 'tint.dll';