ops .. only now I saw this.

You don't need to encapsulate the procedure variable inside a real
procedure. You can call a procedure variable, like if it was a
procedure.

Try this code:

Unit bn;

{$MODE DELPHI}{$H+}
{$packrecords c}

interface

uses ctypes, DynLibs;

type
 bignum_st = record
   d: pointer;
   dmax: cint;
   neg: cint;
   flag: cint;
 end;

 BIGNUM = bignum_st;

 PBIGNUM = ^BIGNUM;

 TBN_bn2hex = function (a: PBIGNUM): PChar; cdecl;

var
 BN_bn2hex: TBN_bn2hex;

function InitLib: Boolean;

implementation

Function InitLib: boolean;
Begin
 LibHandle := LoadLibrary('libeay32.dll');
 Pointer(BnBn2Hex) := GetProcAddress(LibHandle, 'BN_bn2hex');
 result := true;
End;

end.
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to