today is my first day with Delphi.
I have record like this:
type
FT_Device_Info_Node = record
Flags : DWord;
DeviceType : Dword;
ID : DWord;
LocID : DWord;
SerialNumber : array [0..15] of Char;
Description : array [0..63] of Char;
DeviceHandle : DWord;
end;
Later I can read only arrays, e.g. it works: FT_DeviceInfoList[0].SerialNumber
But I can’t get access to any of DWord item, e.g. FT_DeviceInfoList[0].ID is impossible.
Could you clarify it for me?
EDIT:
Here is button click procedure where I want to fet info from record:
procedure TForm1.checkFTDIClick(Sender: TObject);
var
i : integer;
begin
ftStatus := FT_CreateDeviceInfoList(@dwNumDevs);
SetLength(FT_DeviceInfoList,dwNumDevs);
ftStatus := FT_GetDeviceInfoList(FT_DeviceInfoList, @dwNumDevs);
If ftStatus <> FT_OK then ShowMessage('Error '+IntToStr(ftStatus));
Form1.ComboBox1.Items.Clear;
for i:=0 to dwNumDevs-1 do
begin
Form1.ComboBox1.Items.Add(FT_DeviceInfoList[i].Description);//works
//Form1.ComboBox1.Items.Add(FT_DeviceInfoList[i].ID);//compilation error
end;
Form1.ComboBox1.ItemIndex := 0;
end;
FT things are from FTDI library and returned status is OK.
Your intended code is:
This results in a compilation error. That’s because
Addexpects a parameter of typestring. But you are passing aDWORD, an integral parameter.Convert it from an integral data type to a string by calling
IntToStr: