我想利用Delphi调用C语言动态连接库中的函数,各位给个答案,有code最好,分可以再加。这是DLL中的其中一个函数,在Delphi中如何定义这个函数:
BOOL __declspec(dllimport) bAPI4_GetImage(BYTE *picture, int timeout, int iResolution, int* piWidth, int* piHeight);
我是这样定义的:
function  bAPI4_ReadSecureArea( pData: BYTE;iSecNum: integer;idx:integer):boolean;
不知对不对?

解决方案 »

  1.   

    in C++:
    BOOL __declspec(dllimport) bAPI4_GetImage();in Delphi:
    function  bAPI4_ReadSecureArea( var picture byte; timeout,iResolution:integer;var  piWidth:integer;var  piHeight:integer):boolean;stdcall;//cdecl
      

  2.   

    unit filedydll;interfaceuses messages, windows;  function initoRun(channum1 : pchar;channum2: pchar):integer; stdcall;implementation
      function initoRun;             external filedy.dll' name 'iniRun';
    end.
      

  3.   

    var
      Address:Integer;
    begin
      Address :=LoadLibrary('HM130SDK4_TAS5110C1B_HMFV.dll');
      if Address<>0 then  ShowMessage('this is a sample');
    可是调用dll不成功。
      

  4.   

    var
      Address:THandle;
    begin
      Address :=LoadLibrary('HM130SDK4_TAS5110C1B_HMFV.dll');
      if Address<>0 then  ShowMessage('this is a sample');
    可是调用dll不成功。