Autor Beitrag
Aya
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1964
Erhaltene Danke: 15

MacOSX 10.6.7
Xcode / C++
BeitragVerfasst: Fr 21.03.03 17:10 
Hi,

ich hab grad ein Problem mit ner Komponente an der ich bastle..

die Kompo ist vom TCustomControl abgeleitet und hat nur ein TImage auf sich (ist nur ein Beispiel).

Das Image wird zur Laufzeit erstellt und bekommt als OnClick ereigniss das OnClick vom TCustomControl zugewiesen..

Wenn ich nun die Kompo in Programmen verwende klappt das mit dem OnClick immer problemlos, NUR.. wenn ich im OnClick ereigniss meine Kompo lösche.. also mit MyKompo.Free gibt es nen AccessViolation... :cry:

Hat wer ne Idee was ich dagegen machen kann???
Das Liegt wohl an dem TImage (eigentlich ist's ja auch logisch das es ne AccessViolation gibt... :roll: )

Au'revoir,
Aya

_________________
Aya
I aim for my endless dreams and I know they will come true!
MSCH
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1448
Erhaltene Danke: 3

W7 64
XE2, SQL, DevExpress, DevArt, Oracle, SQLServer
BeitragVerfasst: Fr 21.03.03 17:12 
Ups,
du kannst nicht in einer Ereignisroutine derselben Komponente die Free Methode aufrufen. Da beisst sich die Katze in Schwanz. In der Regel ist das übergeordnete Objekt für die Freigabe der ihm gehörenden Komponenten verantwortlich.
mfg
MSCH
Aya Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1964
Erhaltene Danke: 15

MacOSX 10.6.7
Xcode / C++
BeitragVerfasst: Fr 21.03.03 17:14 
Mhh... ja, aber.. bei nem TButton geht's ja auch.. ;)

gibt's da garkeine möglichkeit???

Weil, wenn ich das TImage weglasse und nur nen TCustomControl mache, dann funktioniert es ja... aber sobald nen TImage 'bei is... :(

Au'revoir,
Aya~

PS: Unsere Katze jagt ihrne Schwanz immer... die schafft das sogar oft *g* also muß dashier auch gehen! :twisted:

_________________
Aya
I aim for my endless dreams and I know they will come true!