Jump to content
haentschman

DevExpress: element '' has no parent window

Recommended Posts

Hi all...:classic_cool:

This is my favorite Error message...:classic_unsure: 

 

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. :classic_unsure:

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 by haentschman

Share this post


Link to post

Hi...

Quote

* DevExpress  18.3

* Grid

* Comboboxes

* different Edits

* Layouts

Edited by haentschman

Share this post


Link to post
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

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

Thanks...:classic_smile:

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 :classic_unsure:

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 by haentschman

Share this post


Link to post

Hi all...:classic_cool:

... a few more information. I could do that once ... with breakpoint. :classic_cheerleader:Today the same Sceniario without mistakes. :classic_blink: OnActivate runs through...

 

PS:

Please no funny comments about the source code... :classic_biggrin: i inherited the project. :classic_blush: And these are units where I haven't done anything except the codeformatter.

 

Please help... :classic_unsure:

 

Thanks.

 

 

 

Edited by Daniel
Deleted attachment on request

Share this post


Link to post

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 by ULIK

Share this post


Link to post

Thanks... i try this. :classic_smile:

 

By the way...

image.png.b9ecc1a8dc67e67f7cb82e0f7f0d131f.png

...the error comes only by ComponentState = csFreeNotification! What's that mean?

 
Edited by haentschman

Share this post


Link to post
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

Thanks...:classic_wink:

Quote

Perhaps some component doesn't follow this pattern as closely as it should do. 

:classic_huh:

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

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

Thanks...:classic_smile:

 

Quote

You are fiddling with the Active property of that component. Why?

see...

Quote

Please no funny comments about the source code... :classic_biggrin:i inherited the project.

Its a copy / paste project with over 2Mio lines. In 8 month i cant see everything. :classic_huh:

 

Quote

ULIK has some very pertinent comments above. Did you research h(is/ers) suggestions? 

...at the moment no. :classic_blush: 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. :classic_unsure:

Regardless of that i will heed your tips on working with PropStore.

Edited by haentschman

Share this post


Link to post

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

Hi...

Quote

It was NOT intended as a funny comment

everything will be all right. :classic_cheerleader: I take the wrong emoij :classic_huh: instead of :classic_smile:.

 

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. :classic_unsure:

 

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. :classic_cool: I try...

Share this post


Link to post

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. :classic_unsure:

 

Edit: Just arrived the proposal with the VM by DevExpress. :classic_cool:

Edited by haentschman

Share this post


Link to post

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
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... :classic_cool:

 

Edit: Ticket reopened.

Edit: Ticket closed (16:00)

Edit: Ticket reopened (delete Files.zip)

Edited by haentschman

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×