I need help on how to load the BemaFI32.dll
DLL dynamically in Delphi.
My code looks like this:
function _Bematech_FI_NumeroSerie(NumeroSerie: AnsiString): Integer;
var
xBematech_FI_NumeroSerie : function ( NumeroSerie: AnsiString ): Integer; stdcall;
lHandle : THandle;
begin
lHandle := LoadLibrary('bemafi32.dll');
@xBematech_FI_NumeroSerie := GetProcAddress(lHandle, PChar('Bematech_FI_NumeroSerie'));
if @xBematech_FI_NumeroSerie = nil then
raise Exception.Create('Entrypoint Bematech_FI_NumeroSerie não encontrado na Dll');
Result := xBematech_FI_NumeroSerie(NumeroSerie);
end;
The function return is always -4 , indicating that the BemaFI32.ini
file does not exist. But the file exists.
I have tried to execute the functions Bematech_FI_ReloadINIFile
and Bematech_FI_AbrePortaSerial
before, but always returns the same error.
I'm developing on Delphi XE2 in Windows 10 64 bit. However, I have also tested Windows 7 and the same problem occurs.
The version of BemaFi32.dll is 7.0.4.32.
Has anyone ever had a similar problem?