Hello,
I was having this problem but I resolved it after much trial and error.
I have a tab on a window and I wanted each user object tabpage within the tab to refer to a windows function. I have several user object datawindows on each tabpage and I want them all to have the same data and properties so I use the window to keep them in synch.
To do that, each tab page declares and instance variable of that that window object. When I open the window, I set the instance variables for each tab page to "this", for example
tab_1.tabpage_1.i_parentwindow = this
tab_1.tabpage_2.i_parentwindow = this
......
The tabpages can refer to i_parentwindow to communicate with each other.
My problems started when I started doing this. I could not edit the source for any user object tab page and save it - and worse, the user object would get deleted no matter what I did, even if I declined to save it after getting the error. Sometimes I could and I thought I had it solved but the problem would always come back randomly.
Then I took out this instance variable and simply had the user objects refer to the window object rather than an instance variable. When I open the window, I open the Window object rather than declare an instance of it and open an instance. I can no longer open multiple instances of that window but I don't need to do that.
There is probably a more elegant way to accomplish what I want but this is now working well and without error.
I've tried and tried but I can't put my finger on it. It keeps failing at a certain point when I inherit a new object and step by step put the code in the events. I've got a window inherited from another, from another, from another, (pfc) and a tab inherited from a tab, inherited from a tab, the tab holds several tabpages (userobjects), inherited from tabpage userobject. That userobject holds references to the window it's place upon, etc. I guess it must be some kind of a cyclic reference thing.
Strangely enough, I have another tabpage with the same inheritance and bit less code, which does NOT present this problem of editing the source code.
It's driving me nuts, so time to get some sleep.
Sorry !
regards
This issue has only happened to me a few times but I was always able to correct the problem by performing a full regeneration from the =>Object Browser<=. In the OB, you can expand the full inheritance tree of each object type and then perform a full regeneration from each top level ancestor. This process then *guarantees* that each proceeding ancestor is regenerated properly in sequence as the IDE goes down the inheritance hierarchy tree. In a normal Full Build from the IDE's System Tree, the objects are regenerated in PBL/Object order and *not* in their inheritance order. Thus, descendants can be regenerated before ancestors. Also, the OB regeneration will force code alignment. Food for thought.
The only other time that I got into your predicament and the OB regeneration failed to correct the situation - was when had corrupt source code in an object. The only way I suspected that this could happen was from a bad migration. Took me a while to locate the few lines of bad source code but once edited out, the problem went away permanently.
Regards ... Chris
regards and thanks