[fpc-pascal] Resending: Trying to convert some C code

Henry Vermaak henry.vermaak at gmail.com
Tue Nov 7 12:18:50 CET 2006


i'm no guru, but here's a couple of things that you might try:

{$PACKRECORDS C} to make sure about that struct (gives me problems on
osx if i don't use it)

>   BN_ULONG *d;
what is BN_ULONG?  make sure it's the same size of:
>     d:pointer;

you forgot the calling convention here:
> Type
>   TBN_bn2hex = function(a:BNPtr):PChar;
should have cdecl?

>   LibHandle := LoadLibrary('libeay32.dll');
>   _BnBn2Hex := GetProcAddress( BnLibHandle, 'BN_bn2hex');

i assume that LibHandle should be BnLibHandle?  what are the errors you get?

to get the general idea, see:
http://community.freepascal.org:10000/docs-html/prog/progse53.html#x240-24300012.3

good luck
henry



More information about the fpc-pascal mailing list