Das ist ja ge nau so drin... hm... ich poste mal den initialization-Teil:
GetTempDir feuer bei mir den string
'D:\Users\Temp\' raus.
hLib ist im Implementation als
var hLib: cardinal; deklariert
Delphi-Quellcode:
initialization
if FileExists(GetTempDir + 'libeay32.dll')
then
hLib := LoadLibrary(PChar(GetTempDir + 'libeay32.dll'))
else
hLib := LoadLibrary('libeay32.dll');
if hLib <> 0 then
begin
@BN_new := GetProcAddress(hLib, 'BN_new');
@BN_init := GetProcAddress(hLib, 'BN_init');
@BN_clear_free := GetProcAddress(hLib, 'BN_clear_free');
@BN_free := GetProcAddress(hLib, 'BN_free');
@BN_rand := GetProcAddress(hLib, 'BN_rand');
@BN_num_bits := GetProcAddress(hLib, 'BN_num_bits');
@BN_bin2bn := GetProcAddress(hLib, 'BN_bin2bn');
@BN_bn2bin := GetProcAddress(hLib, 'BN_bn2bin');
@BN_hex2bn := GetProcAddress(hLib, 'BN_hex2bn');
@BN_bn2hex := GetProcAddress(hLib, 'BN_bn2hex');
@BN_is_bit_set := GetProcAddress(hLib, 'BN_is_bit_set');
@BN_cmp := GetProcAddress(hLib, 'BN_cmp');
@BN_set_word := GetProcAddress(hLib, 'BN_set_word');
@BN_lshift := GetProcAddress(hLib, 'BN_lshift');
@BN_add_word := GetProcAddress(hLib, 'BN_add_word');
end;
finalization
FreeLibrary(hLib);
end.
hrm... wird evtl. das finalization zu früh getriggert?