haentschman 92 Posted November 4, 2018 (edited) Hi all... This is my favorite Error message... Project: * 2 mio lines. * DevExpress 18.3 This error ist not new. He exist since more then 10 years by DevExpress! The error comes from time to time. Ticket DevExpress: https://www.devexpress.com/Support/Center/Question/Details/T624801/element-has-no-parent-window Callstack Example: Quote date/time : 2018-11-02, 12:12:54, 362ms computer name : WIN7-P06 user name : XXX registered owner : WIN7-User operating system : Windows 7 x64 Service Pack 1 build 7601 system language : German system up time : 1 day 1 hour program up time : 1 hour 37 minutes processors : 8x Intel(R) Core(TM) i7-2600K CPU @ 3.40GHz physical memory : 12499/16365 MB (free/total) free disk space : (C:) 80,51 GB (W:) 497,73 GB display mode : 1920x1080, 32 bit process id : $13a0 allocated memory : 1,00 GB largest free block : 456,24 MB executable : XXX.exe exec. date/time : 2018-10-31 15:36 version : 1.4.1.100 compiled with : Delphi 10.1 Berlin madExcept version : 4.0.19 callstack crc : $1ce86e39, $2e885e9e, $57e9cf7d exception number : 1 exception class : EInvalidOperation exception message : Element '' hat kein übergeordnetes Fenster. main thread ($e5c): 006e9f94 +0b4 XXX.exe Vcl.Controls TWinControl.CreateWnd 0096b1a2 +022 XXX.exe cxControls 8288 +3 TcxControl.CreateWnd 00a2a9e3 +087 XXX.exe cxContainer 3911 +12 TcxContainer.CreateHandle 00ab0156 +00a XXX.exe cxEdit 7745 +1 TcxCustomEdit.CreateHandle 00afcf96 +00a XXX.exe cxDropDownEdit 2613 +1 TcxCustomDropDownEdit.CreateHandle // every time this line! 0282a897 +00f XXX.exe Form.MainMenu 361 +2 TfoMenuMain.pnlLeftClick // (TfoMenuMain) ->Self.Close; // Form WITHOUT DevExpress! 02d95c91 +d59 XXX.exe SEAM 328 +216 initialization Any ideas? Thanks.. Edited November 4, 2018 by haentschman Share this post Link to post
Guest Posted November 5, 2018 No, sorry not much. But can you reproduce this each time or is it "intermittent"? Share this post Link to post
haentschman 92 Posted November 5, 2018 Hi... ...its always "intermittent" and at differrent source code positions. Thanks... Share this post Link to post
weirdo12 21 Posted November 5, 2018 What DevExpress components are you actually using with your project? Share this post Link to post
haentschman 92 Posted November 5, 2018 (edited) Hi... Quote * DevExpress 18.3 * Grid * Comboboxes * different Edits * Layouts Edited November 5, 2018 by haentschman Share this post Link to post
weirdo12 21 Posted November 5, 2018 Just now, haentschman said: Hi... I suppose you mean 18.1.3. So which components do you use? I don't see the issue that you are describing. I'm using the Grid, Inspector, Bar Manager, Skin Controller, Printing, part of Scheduler. I'm using 18.1.6 with C++Builder Seattle 10 (No Update) and Tokyo 10.2.3. Share this post Link to post
Guest Posted November 8, 2018 I can only guess... One guess is that there is something left in some dfm 🙂 from previous versions of your project (maybe previous versions of DX too), possibly a sub-component to a DX component. The component (perhaps a LayoutControl or a GridView or a BarManager) does not create it at creation time because it does not need to BUT when things are to get destroyed the little "Handle" getter function goes and creates one (handle that is). Possibly because the streaming system wants to pick up a property. If this is true then it is a bug in the DX components, but alas one that would be very difficult to pin down even for the vendor. The call before CreatHandle looks odd. Looks like there are entries missing. It could indicate the failing component (the DropDownEdit) did not release message-handling things as it should have. Lot's of guesswork here... ouch. So what can you do? Possibly not much besides going through all dfm's and looking for something that is not used. Logging any changes you have made between production versions (if it happen at clients sites) and then compare the reports you get from MadExcept. Tedious, yes... Share this post Link to post
haentschman 92 Posted November 8, 2018 (edited) Thanks... Quote does not create it at creation time because it does not need to BUT when things are to get destroyed the little "Handle" getter function... That's what I think, too. A message problem. Quote Logging any changes you have made between production versions ...it's always been like this Quote The call before CreatHandle looks odd. Looks like there are entries missing. I am on vacation...next week i get a more detailed Callstack with debugging information from VCL. Edited November 8, 2018 by haentschman Share this post Link to post
Guest Posted November 8, 2018 Quote I am on vacation...next week i get a more detailed Callstack with debugging information from VCL. Cool. Share this post Link to post
haentschman 92 Posted November 27, 2018 (edited) Hi all... ... a few more information. I could do that once ... with breakpoint. Today the same Sceniario without mistakes. OnActivate runs through... PS: Please no funny comments about the source code... i inherited the project. And these are units where I haven't done anything except the codeformatter. Please help... Thanks. Edited November 28, 2018 by Daniel Deleted attachment on request Share this post Link to post
ULIK 16 Posted November 27, 2018 (edited) Just an idea: check the code for cxPropStore on TFormEdAnlagen.FormClose as well as TFormEdTeil.FormClose . It is explicitly activated which should automatically save the properties on form close but then you also manually save them. Do you also get the error when you do not activate it (or remove the entire cxpropstore code) ? Maybe the explicitly activating triggers some recreation of controls. Also I would test if removing BarManager.BeginUpdate; ... BarManager.EndUpdate; on the FormClose procedures makes a difference (if I remember right, BarManager.EndUpdate triggers at leats a repaint of the controls but maybe also a recreation). And I don't think that storing the settings requires an enclosure with BeginUpdate...EndUpdate) kind regards, Ulrich Edited November 27, 2018 by ULIK Share this post Link to post
haentschman 92 Posted November 27, 2018 (edited) Thanks... i try this. By the way... ...the error comes only by ComponentState = csFreeNotification! What's that mean? Edited November 27, 2018 by haentschman Share this post Link to post
Uwe Raabe 2064 Posted November 27, 2018 30 minutes ago, haentschman said: ComponentState = csFreeNotification! What's that mean? The component is going to notify other components when it is destroyed. A component can register for FreeNotifications by calling AComponent.FreeNotification(Self) and unregister with AComponent.RemoveFreeNotification(Self). The notification is done by calling the Notification method of all those registered components. This is usually done to update a local field pointing to that component to prevent dangling pointers. Perhaps some component doesn't follow this pattern as closely as it should do. Share this post Link to post
haentschman 92 Posted November 27, 2018 Thanks... Quote Perhaps some component doesn't follow this pattern as closely as it should do. But...at this point the owner is not destroyed (imho)! GridEdAnlagenDBTableViewANL is auto created with the form and the form ist destroyed at Application.Close???? Share this post Link to post
Guest Posted November 28, 2018 ULIK has some very pertinent comments above. Did you research h(is/ers) suggestions? It is very difficult to look at the code you attached since it's kind of out of context. I'm looking at cxPropStore (in both forms). You are fiddling with the Active property of that component. Why? From what i can see you are using the component "manually" calling either StoreTo or RestoreFrom. IMHO the property should be False and stay false. Always. The component (when Active) will kick in stuff at form cleanup/destruction. HTH, /Dany Share this post Link to post
haentschman 92 Posted November 28, 2018 (edited) Thanks... Quote You are fiddling with the Active property of that component. Why? see... Quote Please no funny comments about the source code... i inherited the project. Its a copy / paste project with over 2Mio lines. In 8 month i cant see everything. Quote ULIK has some very pertinent comments above. Did you research h(is/ers) suggestions? ...at the moment no. But i think the problem is placed in the messaging system from DevExpress and not in my code. Normally i work with the undocked designer. No chance! If i clicked on the ribbon the same error is raised in the IDE. Regardless of that i will heed your tips on working with PropStore. Edited November 28, 2018 by haentschman Share this post Link to post
Guest Posted November 28, 2018 I'm not asking or commenting about code quality, i'm trying to help. It was NOT intended as a funny comment 😞 Seriously - look at the component. You *legacy code* is turning the Active property on and off even though your *legacy code* uses manual store/restore. IMHO you should root out all Active := true. I do not think they are needed and with this property set to true you could run into problems similar to what you describe. It may not be the cause but it is definitely worth a serious try. Regarding message system, i do not think it is directly related. Though looking at this post *may* help you to get a better IDE experience. BTW - once a long time ago when i had another very messy problem i put up a VM so the DX team could debug my complete sources with all other 3rd party components. Might be worth a try. /D Share this post Link to post
haentschman 92 Posted November 28, 2018 Hi... Quote It was NOT intended as a funny comment everything will be all right. I take the wrong emoij instead of . Quote and especially when you are using visual inheritance the skinning system In the current project i use abundant visual inheritance. In the old project was every form unattached. The old project was skinning with AlphaControls and DevExpress. I have deleted the AlphaControls! Now the error raised an other positions. I think there might be a control (ComboBox) in the DFM and PAS but it's not visible. Bad: I don't have a trainee for punishment. Quote Though looking at this post ...exactly i do so. Quote BTW - once a long time ago when i had another very messy problem i put up a VM so the DX team could debug my complete sources with all other 3rd party components. Might be worth a try. ...they do that? Cool. I try... Share this post Link to post
Guest Posted November 28, 2018 @haentschman, ok cool! They might not be willing to do it, it was a looong time ago. However, as you know, you may post a "locked" ticket and ask. Share this post Link to post
haentschman 92 Posted November 28, 2018 (edited) I have a Ticket. https://www.devexpress.com/Support/Center/Question/Details/T624801/element-has-no-parent-window Problem: Even devexpress can't understand this. How am I supposed to find the error? I join the queue of others who fight with the same bug. With the other developers there are different controls. Edit: Just arrived the proposal with the VM by DevExpress. Edited November 28, 2018 by haentschman Share this post Link to post
Guest Posted November 28, 2018 Yes, that ticket is locked. I cannot see it. So you can use it to ask if they are willing to download and start a VM and try to help by actually tracing your actual project. Share this post Link to post
haentschman 92 Posted November 28, 2018 (edited) Quote Yes, that ticket is locked. Just because a callstack contains personal data. When i remove it, i open the ticket again. They have the same information like you... Edit: Ticket reopened. Edit: Ticket closed (16:00) Edit: Ticket reopened (delete Files.zip) Edited November 29, 2018 by haentschman Share this post Link to post