Einzelnen Beitrag anzeigen

shmia

Registriert seit: 2. Mär 2004
5.508 Beiträge
 
Delphi 5 Professional
 
#4

Re: EAccessViolation bei Änderung von dynamischem Array

  Alt 5. Jan 2007, 10:22
Ich würde statt array of TImage ganz eindeutig zu der Kontainerklasse TComponentList raten.
Das vereinfacht das Handling und erweitert deine Möglichkeiten.
Du solltest wirklich keinen Gedanken an das dynamische Array mehr verschwenden.

Description

Use a TComponentList to store and maintain a list of components. TComponentList provides properties and methods to add, delete, rearrange, locate, access, and sort components. Like TObject List, TComponentList controls the memory of its components; unless the OwnsObjects property is set to False (or the components are removed with the Extract method), TComponentList frees its components when they are removed from the list or when the TComponentList instance is itself destroyed.

In addition, TComponentList tracks its components. Whenever a component is freed, TComponentList automatically updates itself by deleting the reference to the freed component and packing the list.
Andreas
  Mit Zitat antworten Zitat