I declared the dll call like below:
const
MTXMLMCR_DLL = 'MTXMLMCR.dll';
Type
PDeviceType = PChar;
function MTMICRGetDevice(dwDeviceContext : DWORD ; pDevName : PDeviceType): ULONG; external MTXMLMCR_DLL; //stdcall;
I am trying to connect the Device by writing the code like below and I got the Access violation at the call "Result := MTMICRGetDevice(1,@DeviceName);"
function TfraExcellaChequeScanner.ProcessCheque: String;
var
nRet : Integer;
strLog,strTmp : String;
begin
nRet := -1;
ProcessInit;
nRet := SetupOptions;
if (nRet <> MICR_ST_OK) then
begin
strLog := 'Setup Options FAILED...';
Showmessage(strLog);
end
else
begin
strLog := 'Setup Options SUCCESS...';
Showmessage(strLog);
end;
end;
function TfraExcellaChequeScanner.SetupOptions: Integer;
var
DeviceName : String;
PDeviceName : ^String;
begin
DeviceName := 'EXCELLA_USB';
PDeviceName := @DeviceName;
Result := MTMICRGetDevice(1,@DeviceName);
end;
procedure TfraExcellaChequeScanner.ProcessInit;
begin
MICR_ST_OK := 1;
MICR_ST_DEVICE_NOT_FOUND := 0;
MICR_ST_BAD_PARAMETER := -1;
end;