There is no error message. When that statement executes, the program crashes and the IDE displays the CPU page. The code that is causing this problem worked fine when I was running ImageEn 2.1. I'll include the actual code below:
I don't know if this matters, but the old "unregistered" banner still appears in the IDE, but not at runtime.
procedure TfrmABSinterface.GetAvailableDPI;
var
i, iMaxX, IMaxY, Imax : integer;
begin
try
{----- Get Maximum Available Resolution (DPI) from the device. }
iMaxX := Trunc(frmMain.ImageEnMView1.MIO.TwainParams.XResolution.RangeMax);
iMaxY := Trunc(frmMain.ImageEnMView1.Mio.TWainParams.YResolution.RangeMax);
{----- Pick the lowest between X and Y because we only display one value.}
if iMaxX > iMaxY then
iMax := iMaxY
else
iMax := iMaxX;
{----- The array max is 10 so don't go beyond.}
if iMax > 10 then
iMax := 10;
{----- We can't read DPI. ASSUME scanner can 300 DPI.}
if iMax = 0 then
iMax := 4;
{----- Populate the combobox items}
For i := 0 to iMax do
begin
if DPI[i] > DPI[iMax] then
Break;
cboResolution.Items.Add( IntToStr(DPI[i]) + ' Dots per inch.');
end;
{----- Set the cbo text value to match one in the list.}
if iMax >= 2 then
cboResolution.ItemIndex := 2
else
cboResolution.ItemIndex := iMax;
except
on E: Exception do
begin
ShowMessage(E.Message);
end;
end;
end;