Ich meinte auch
array of tPvCameraInfoEx;
Wenn du dynamische Arrays verwendest und diese als Pointer uebergeben willst musst du immmer @Array[0] uebergeben, niemals @Array, denn vor dem 1. Element sind noch andere Daten gespeichert (Laenge).
Also entweder du verwendest ein statisches Array (dann geh @Array aber auch dort ist @Array[0] erlaubt) oder ein dynamisches mit @Array[0].
Delphi-Quellcode:
tPvInterface =
(ePvInterfaceFirewire = 1, // Firewire interface
ePvInterfaceEthernet = 2, // Ethernet interface
__ePvInterface_force_32 = $FFFFFFFF
);
tPvCameraInfoEx = Packed Record
StructVer : Cardinal; // Version of this structure
//---- Version 1 ----
UniqueId : Cardinal; // Unique value for each camera
CameraName : array[0..31] of char; // People-friendly camera name (usually part name)
ModelName : array[0..31] of char; // Name of camera part
PartNumber : array[0..31] of char; // Manufacturer's part number
SerialNumber : array[0..31] of char; // Camera's serial number
FirmwareVersion : array[0..31] of char; // Camera's firmware version
PermittedAccess : Cardinal; // A combination of tPvAccessFlags
InterfaceId : Cardinal; // Unique value for each interface or bus
InterfaceType : tPvInterface; // Interface type; see tPvInterface
end;
tPvCameraInfoExList = array of tPvCameraInfoEx;
tConnectedCams = Cardinal;
Function PvCameraListEx (pList : pPvCameraInfoExList; ListLength : Cardinal; out pConnectedNum : pConnectedCams; Size : Cardinal) : Cardinal; stdcall; external 'PvAPI.dll';
Var listAVTGigECams : tPvCameraInfoExList;
valNumberOfCams : Cardinal;
valAvailableCams : Cardinal;
i: Integer;
begin
SetLength (listAVTGigECams, 1);
valNumberOfCams := PvCameraListEx (@listAVTGigECams[0], Length (listAVTGigECams), valAvailableCams, SizeOf (tPvCameraInfoEx));
Sleep (100);
memo1.Lines.Add ('High value : ' + IntToStr(High (listAVTGigECams)));
memo1.Lines.add ('Number of cams in list : ' + IntToStr (valNumberOfCams));
memo1.Lines.add ('Number of cams available: ' + IntToStr (valAvailableCams));
For i := 0 to valNumberofCams-1 do
Begin
Memo1.Lines.Add (IntToStr (listAVTGigECams[i].UniqueID));
Memo1.Lines.Add (listAVTGigECams[i].CameraName));
end;
end;