中国开发网: 论坛: 程序员情感CBD: 贴子 342048
UnKnow365
请教熟悉C与Delphi的大牛,有关C编写的DLL函数在Delphi如何声明?
int STDCALL SDT_ReadBaseMsg(int iPortID,unsigned char * pucCHMsg,unsigned int * puiCHMsgLen,unsigned char * pucPHMsg,unsigned int *puiPHMsgLen,int iIfOpen);
这样的函数在Delphi如何声明、调用?
谢谢!
我是这样声明的:
function SDT_ReadBaseMsg(iPort:integer;pucCHMsg:array of UCHAR;puiCHMsgLen:Integer;pucPHMsg:array of UCHAR;puiPHMsgLen:Integer;iIfOpen:integer):integer;stdcall;external 'sdtapi.dll' name 'SDT_ReadBaseMsg';

定义变量
var
pucCHMsg:array[0..1023] of uchar; //文字信息
pucPHMsg:array[0..1023] of uchar; //照片信息
uiCHMsgLen,uiPHMsgLen:integer;
调用
iRet := SDT_ReadBaseMsg(Com,
pucCHMsg,
uiCHMsgLen,
pucPHMsg,
uiPHMsgLen,
0);
程序一运行到这句就出错(编译可以通过)!
日出东海落西山,愁也一天,喜也一天;遇事不钻牛角尖,人也舒坦,心也舒坦。

相关信息:


欢迎光临本社区,您还没有登录,不能发贴子。请在 这里登录