刚搜到的一个
http://www.china-askpro.com/msg43/qa60.shtml
操作系统: win98
编程工具: delphi5.0 bc++
问题: 问题:
请问在BC++中这样的两个函数在DELPHI中该怎样调用?
#define DLLEXPORT __declspec(dllexport)
//初始化图形参数
DLLEXPORT void APIENTRY EW_GetImagePara(short *iImageWidth,short *iImageHeight)
//采集图形信息
DLLEXPORT void APIENTRY EW_GetDeviceImage(unsigned char *pImage)
#endif
希望能给出代码,谢谢了。
水平: 刚入门
回答:
你这两个函数都有APIENTRY,说明是stdcall的。
Procedure EW_GetImagePara(var iImageWidth: word; var iImageHeight:word); stdcall; external 'your.dll';
由于是指针,所以这里使用var进行定义。当然你也可以使用Delphi的指针类型。