请问,在DELPHI中调用DLL中的函数的方法(100分)

  • 主题发起人 主题发起人 Delphi新手1.0
  • 开始时间 开始时间
D

Delphi新手1.0

Unregistered / Unconfirmed
GUEST, unregistred user!
给个例子先?
 
还是先搜一下吧,铺天盖地的都是
 
刚搜到的一个
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的指针类型。

 
多谢两位
 
后退
顶部