converting an application from 4.2 to 6.0 I face another incompatibility.
Unify seem to have messed arround a lot with the GUI.
I just realized, that during SAM_Destroy of a modal dialog box a I cannot get any data any more, based on the window handle - no Parent, no type, no nothing. So it seems the message is sent AFTET the window is already destroyed.
So I have to make some sort of workarround in my base classes which need to know whicht type of top level window is destroyed an what the size was.
What I would like to know, is this beahviour just a glitch in 6.0 SP 8 or is it also appearent in the newer release 6.1 - 7.0?
As you might understand, I don't want to make a workarround which bytes me in the a... with the next version.
how do you close the modal dialogs?
I usually have some kind of "OK" and "Cancel" (or other actions) buttons that read the data entered into the fields, do some validation and finally close the dialog using SalEndDialog function.
So I don't need to access the data fields in subsequent messages like SAM_Destroy.
You wrote, that you access the data based on window handles.
Could you give us some sample code to see, how you do this data access?
In my personal oppinion, accessing data fields using window handles should be avoided as long as possible.
it's not a matter of accessing any controls or data fields inside the closing dialog.
My base classes save position state and size of the windows at closing time. This is normal for all Top Level windows and is working from day one in TD.
In 6.0 the dialog boxes as an exception seem to be destroyed BEFORE the SAM_Destroy message is sent. All other Toplevel Windows still behave as expected.
So this is a bug in my opinion and I am simply searching for the best way to cope with that.
- Founder/Site Admin
- Posts: 1188
- Joined: 24 Feb 2017, 09:12
- Location: Gouda, The Netherlands
I can not reproduce your issue.
It is always best to create and attach a simple testcase along with your issue description here, so we can investigate.
I created a testcase, but I can get all stuff from the window handle on destruction of the dialog.
(on TD60 SP8)
I'm doing this as well. In the case that my customer chooses the Close command from the window's system menu or the "X" instead of closing the dialog using the "Ok" or "Cancel"-Button, I'm doing this on SAM_Close and not on SAM_Destroy.
Uwe van der Horst
thanks for your help. Unfortunately I have to apologize for taking this to the forum.
My assumption simply was wrong. It was caused by the hWndForm<->hWndFrame difference in 6.0
So in fact I used the wrong handle to get the parameters.
Sorry for the the confusion and thanks Dave for taking the time to make a your sample.
Who is online
Users browsing this forum: [Ccbot] and 0 guests