Component destroy, error!


2005-03-03 11:45:41 PM
cppbuilder36
Inside component:
ParentForm->Perform(WM_NEXTDLGCTL, 0, 0);
if(FLabelEdit->FIndex>-1)
OnExit Event
frmMain->DestroyActive(false);
frmMain function
FActive->Free();
FActive = new TfrInicial(this);
FActive->Visible = true;
FActive->Parent = frmMain->pnlFrame;
(FActive is the Frame that contain my component);
When I do the first line, it's fire OnExit event, and in some situation I
will Free all my TFrame so FLabelEdit and others components does not exists
more, and I got a error message
---------------------------
De{*word*81} Exception Notification
---------------------------
Project SGC.exe raised exception class EInvalidOperation with message
'Control '' has no parent window'. Process stopped. Use Step or Run to
continue.
---------------------------
OK Help
---------------------------
Any idea to contorn this problem?
Thanks
Arnaldo Giacomitti Junior.