[DUG] Compnent creation question

Paul Heinz paul at accredo.co.nz
Wed Oct 15 16:59:26 NZDT 2008


Rob asked: 

> Same error. 
> 
> Further info.  The error is now showing 'Control 'CB' has no parent'  
> where CB is the name of the combobox.  manually freeing the combobox 
> using a button and a .free works perfectly (all objects are 
> freed and no 
> erros).

At a guess, from memory, I think the Combo Items are managed a TStrings
wrapper class which synchronises with the internal items list of the
Micrsoft COMBO control builtin.

So, the TStrings layer is sending delete notifications, and it might be
attempting to send the necessary Window messages to the backing COMBO.

But, since the TCombo box is currently a partially destroyed zombie
control, it might end up causing Delphi to attempt to recreate it (i.e.
to get a window Handle for the message)

In the process of recreating the zombie, it might thus complains about
missing Parents, which is a Window handle related concern.

Now, this is all just a grand theory 
(well, hypothesis to be pedantic i.e. I pulled it out of my ...)

So are you calling your new code _before_ or _after_ the call to the
inherited in the destructor?

TTFN,
  Paul.







More information about the Delphi mailing list