读书人

帮忙看一上啊该如何定义和调用delphi里

发布时间: 2012-09-27 11:11:17 作者: rapoo

帮忙看一下啊,该怎么定义和调用delphi里的第三方DLL
函数:BOOL IO_GetPageDimension(VOID *p, long *imgwide, long *imghigh);
Parameters
p
[in] Pointer to structure 'set_attribute ';
imgwide
[out] Syscan scanner return accepting the scan width;
imghigh
[out] Syscan scanner return accepting the scan height;

我定义的:
type
set_attribute = Record
scan_mode:shortint;
resolution:smallint;
brightness:shortint;
contrast:shortint;
gamma:shortint;
highlight:smallint;
shadow:smallint;
.......
end;
function IO_GetPageDimension(p: set_attribute; imgwide: Longint; imghigh: Longint):Boolean;stdcall;external
'A8100.dll ';
在窗体中调用:
begin
p.highlight:= 100;
p.scan_mode:= 4;
p.resolution:=300;
p.brightness:= 100;
p.contrast:= 80;
p.gamma:= 80;200;
p.shadow:= 200;
IO_GetPageDimension(p: set_attribute; imgwide: Longint; imghigh: Longint);
end;
在生成EXE文件时出错,提示:not enough actual parameters。出错的地方在 IO_GetPageDimension(p: set_attribute;imgwide: Longint; imghigh: Longint);的set_attribute上
不知道是我定义错了还是调用出错。有谁知道该怎么定义,怎么调用啊?

[解决办法]
试试:

type
pset_attribute = ^set_attribute;
set_attribute = Record
scan_mode:shortint;
resolution:smallint;
brightness:shortint;
contrast:shortint;
gamma:shortint;
highlight:smallint;
shadow:smallint;
.......
end;
function IO_GetPageDimension(p: pset_attribute; imgwide: pinteger; imghigh: pinteger):BOOL;stdcall;external
'A8100.dll ';



调用:
IO_GetPageDimension(p,imgwide,imghigh);

读书人网 >.NET

热点推荐