CustomControl -> GraphicControl component order problem

2007-09-05 08:39:33 AM
I have two controls A and B. A decends from GraphicControl and B decends
from CustomControl.
B depends on or uses A, so B has A.bpi in its requires list.
Both controls add themselves to the IDE as long as A is added first.
place an instance of A on the form then place B on the form.
Save as F1.cbproj close Builder, then reopen Builder and the form; Builder
opens the form, and works fine.
However, start a new project F2.cbproj with B on the Form and A in a Panel.
Form works till Builder is closed.
Start Builder, open project, B is instantiated, but A.Register() fails as
though the 'uses' order is messed up. F2frm.dfm shows that B is the first
object in the list on the form.
Stop Builder, start again, open F1.cbproj; Works fine.
Close F1.cbproj, open F2.cbproj; Works fine! LOL!
Stop Builder, start again, open F2.cbproj; A.Register() fails.
Close F2.cbproj, open F1.cbproj; A.Register() fails.
IDE seems to be loading (Registering) A or B first depending on order on
Form rather than package 'uses'. It appears to be disabling A and B if B is
This has, likely, something to do with the #pragma package(smart_init)
initialization order, but I've no clue why.
Any ideas about what i goofed up this time?