首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

帮忙看一上啊该如何定义和调用delphi里的第三方DLL

2012-09-27 
帮忙看一下啊,该怎么定义和调用delphi里的第三方DLL函数:BOOLIO_GetPageDimension(VOID*p,long*imgwide,lo

帮忙看一下啊,该怎么定义和调用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);

热点排行