Help! Control Has no parent window (D6 Enterprise)

I have an app that I have had to convert to a dll under a more general app.
On the main form is a TTreeView. Its parent is a TPanel. The panel's parent
is the form. The form's owner and parent is a tabcontrol on one of the
general app's forms.

Clicking on various controls on the form is not a problem, but when I click
on the TTreeview, I get...

EInvalid Operation, Control tvTable has no parent window

And I can not find where the exception happens. Somewhere after exiting the
OnClick Handler and before reaching the OnAdvancedCustomDrawItem.