Im getting the following
Access violation at address 00404340 in module 'test.exe'. Read of address FFFFFFD5
with the following code
var
List: TStrings;
In the Create Section:List:= TStringList.Create;
Adding to the list:Result := List.AddObject('hi', aCreatedObject);
MessageDlg(FunctionHookList.Objects[Result].ClassName, mtInformation, [mbOK], 0);
The Message dialog shows the correct classname
But later when i do,
i := list.IndexOf('hi');
if i >= 0 then
if list.Objects[i] <> nil then
if assigned(list.Objects[i]) then
begin
tmp := list.Objects[i];
if tmp <> nil then
MessageDlg(tmp.ClassName, mtInformation, [mbOK], 0); //*******
end;
i get the Access violation above at on the //******* line
I know there is a bit of duplicated code there, but i was trying to check 'everything'
if i >= 0 then begin tmp := Objects[i]; if Assigned(tmp) then ...- mjn<> nilandassignedwould catch it if it was. - Christopher Chase