UnKnow365:
请教熟悉C与Delphi的大牛,有关C编写的DLL函数在Delphi如何声明?
[阅读: 954] 2006-06-13 06:50:56
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);
程序一运行到这句就出错(编译可以通过)!