Naktibalda
Programmer
This is a bug which has been driving me crazy! I have a base custom frame which is inherited by other classes. The code has functioned properly for a long time, but sometimes it "acts up". Strange things will cause an error message to appear upon instantiating a derived class of the base custom frame. The error is "Project_nnVasculatureGeneration.exe raised exception class EInvalidOperation with message 'Control 'Label5' has no parent window'. Process stopped."
Now if i delete label5, it will raise the same error for label4. If i delete all the labels it will operate normally again (sometimes). This is strange because there are other controls in the derived class (buttons, panels, toolbars etc). If i then put the label back into the derived class it will often work normally.
Once the error is raised the code seems to be irreversibly broken. I've found that things such as adding a space after the ; sign in a seemingly unrelated unit will sometimes cause this error to show up. If I undo all the changes i made, the error still persists.
Perhaps Delphi does or saves something at runtime which would cause this error to persist even after I've undone any changes I made to the code to restore it back to the state it was in before the error..
The actual error is brought about by a line which instantiates the custom frame. I will list it below, but it works most of the time..
In the derived class
Application.CreateForm(TCustomForm, customForm);
self := create(customForm,0,0);
which is sent to the base class's constructor (which is a custom frame)
constructor TBaseMeshFrame.create(aParent: TWinControl; aLeft, aRight:double);
begin
inherited create(aParent);
self.Parent := aParent;
At this point, ANY advice would really be appreciated. I've been pulling my hair out about this one..
Thanks in advance
Now if i delete label5, it will raise the same error for label4. If i delete all the labels it will operate normally again (sometimes). This is strange because there are other controls in the derived class (buttons, panels, toolbars etc). If i then put the label back into the derived class it will often work normally.
Once the error is raised the code seems to be irreversibly broken. I've found that things such as adding a space after the ; sign in a seemingly unrelated unit will sometimes cause this error to show up. If I undo all the changes i made, the error still persists.
Perhaps Delphi does or saves something at runtime which would cause this error to persist even after I've undone any changes I made to the code to restore it back to the state it was in before the error..
The actual error is brought about by a line which instantiates the custom frame. I will list it below, but it works most of the time..
In the derived class
Application.CreateForm(TCustomForm, customForm);
self := create(customForm,0,0);
which is sent to the base class's constructor (which is a custom frame)
constructor TBaseMeshFrame.create(aParent: TWinControl; aLeft, aRight:double);
begin
inherited create(aParent);
self.Parent := aParent;
At this point, ANY advice would really be appreciated. I've been pulling my hair out about this one..
Thanks in advance