procedure SaneGetDeviceList ( aList: TStrings ) ;
var
x: longint;
res: SANE_Status;
Devicelist: ^DeviceArray;
s: string;
begin
//test
res := sane_init(0, nil);
if res = SANE_STATUS_GOOD then
try
res := sane_get_devices(Devicelist,SANE_FALSE); // <<<<<<<< Hier tritt der Fehler auf
x := 0;
if res = SANE_STATUS_GOOD then
while Devicelist^[x] <> nil do
begin
s := Devicelist^[x]^.name;
aList.Add(s);
Inc(x);
end;
finally
sane_exit;
end;
end;
Hat das eventuell schon mal jemand hin bekommen?
Zuletzt geändert von MacWomble am Fr 25. Mai 2018, 16:09, insgesamt 1-mal geändert.
Alle sagten, dass es unmöglich sei - bis einer kam und es einfach gemacht hat.
procedure SaneGetDeviceList ( aList: TStrings ) ;
var
x: longint;
res: SANE_Status;
Devicelist: DeviceArray;
s: string;
begin
//test
res := sane_init(0, nil);
if res = SANE_STATUS_GOOD then
try
res := sane_get_devices(@Devicelist,SANE_FALSE); // <<<<<<<< Hier tritt der Fehler auf
x := 0;
if res = SANE_STATUS_GOOD then
while Assigned(Devicelist[x]) do
begin
s := Devicelist[x]^.name;
aList.Add(s);
Inc(x);
end;
finally
sane_exit;
end;
end;
Oder ist sane_get_devices call by reference? dann macht das was ich geschrieben hab keinen sinn