The access exception happens on the Grow call with a read of address 00000000; In this "classes" library code:
function TList.Add(Item: Pointer): Integer;
begin
Result := FCount;
if Result = FCapacity then
Grow;
FList^[Result] := Item;
Inc(FCount);
if Item <> nil then
Notify(Item, lnAdded);
end;
The other wierd thing that I notice is the Class Hierarchy explorer view is confused. Objects appear and disappear and the hierarchy is not complete at times. It appears that it reparses when files are saved, which is when things come and go..
Has anyone seen this behavior before, or have an idea of what to look for to fix it.??
Thanx..
Since this problem seemed to be localized, I thought (grasping at straws) that perhaps some instrumentation might help, so I turned on CodeGuard. This indicated that some memory overwrites were occuring. I fixed a series of these issues and the instantiation was successful.
From this I surmise that the memory overwrites, which were not severe enough to cause an exception, were disturbing either the this pointer or other object attributes and in turn causing the instantiation failures.
Hope this helps others..