Griff,
The problem does seem to be related to placing objects into containers in sub-classes, where the container is a sub-class as well.
Not using an OOP or non-visual approach in my view defeats the purpose. Flattening the object model a bit, I'm ok with. But interestingly, the thing that lead me down the path first was the label object, mostly because it is so heavily used, though it is not specifically the problem. "Nesting" 2 or 3 layers deep I did not think should be a significant issue, and at run time, of course it's not. In fact at design time, doesn't seem to be either, it's a compiler issue, which is resolved by a "CLEAR ALL". So to reverse engineer everything back to Fox2.6, I might as well just go back to FPW2.6. I may keep my "layering" as is once I've resolved what is causing it, and ignore the error. It all started from sub-classing a form class, which then had some "new" objects I added to it which essentially are containers that are meant to provide an improved experience to the user. These two containers are a "pop-out" on-screen help system that you can access by clicking a "?" button from the topline menu, and is context sensitive to the screen/tab you are on. It works great, and is a nice interface enhancement, but when it became containers within containers (as I wanted a more modern "button" feel, I've created my own button class using containers and text or images, where appropriate. And I have a text button and an image button which are separate (because I can't get a button without a border on it!)
One issue seems to be, when you have containers on a container that is on a form, for example, and the "top container" (the one furthest down the tree) has a text label on it, and you just let the system name the label like "Label1", and then the container below it also has a "label1" and then the form somewhere on it maybe has a "label1", now the should all be "hidden" from each other by the object they are contained in, but I can now prove that the compiler doesn't see it that way... and that is incredibly annoying. (At least it doesn't see it when determining if a class has been opened, which 'label1' is which, and generates then doesn't release the object(s) from memory as it should, resulting in this error when building from the project's "Build" button (so may also be a specific interaction with the project Manager). Don't know if I'll ever get an answer to either of those, but I am looking for the solution now.
One thing that seems to resolve the issue is, let's say I have a "form class library" and a "baseclasses library" (really for objects you put ON forms, but no forms in the lib) and a "navigation library". So putting objects from baseclasses onto forms is no problem. Even subclass the form, all is well. BUT in the navigation library, base those objects first on a container (from baseclasses) then add a label and a text box (and for good measure, add a container to that container, and put an image on it, for instance). Now put that class on your lowest level form class, and all is fine. BUT open a form that is sub-classed to that form, and when you close it and try to compile, boom.
But I found if, in the Navigation sub-class, I make a new "Container", and I make a new "Label" and "Textbox", and I use those objects within that class (no matter how much I stack them up), and then place THAT on the form and the subform inherits it, then... all is well.
Incredibly incredibly annoying.
It actually seems to diminish the value of sub-classing. I never sub-class more than 3 layers, and it's only after the 2nd layer it becomes an issue (as I can tell). But I'm not 100% complete with testing this theory yet. But so far, all I have described is resulting in preventing the error message from occurring, and the objects getting stuck in memory.
Best Regards,
Scott
ATS, CDCE, CTIA, CTDC
"Everything should be made as simple as possible, and no simpler."
![[hammer] [hammer] [hammer]](/data/assets/smilies/hammer.gif)