Solved SAM_Destroy on dialog boxes in 6.0 SP8

Discussion forum about all things Team Developer 5.x and 6.x
wilhelm
Germany
Posts: 283
Joined: 22 Mar 2017, 08:49
Location: Cologne

SAM_Destroy on dialog boxes in 6.0 SP8

Post by wilhelm » 01 Jul 2017, 14:12

Hi,

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.
TIA
WIlhelm

wilhelm
Germany
Posts: 283
Joined: 22 Mar 2017, 08:49
Location: Cologne

Re: SAM_Destroy on dialog boxes in 6.0 SP8

Post by wilhelm » 01 Jul 2017, 14:29

BTW a modeless Dialog Box behaves the same..

User avatar
markus.essmayr
Austria
Posts: 892
Joined: 06 Mar 2017, 06:07
Location: Austria

Re: SAM_Destroy on dialog boxes in 6.0 SP8

Post by markus.essmayr » 02 Jul 2017, 10:19

Hi,

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.

Thanks!
Max
Markus Eßmayr
teamdeveloper@t-mx.com

wilhelm
Germany
Posts: 283
Joined: 22 Mar 2017, 08:49
Location: Cologne

Re: SAM_Destroy on dialog boxes in 6.0 SP8

Post by wilhelm » 02 Jul 2017, 10:33

Hi Marcus,

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.

Cheers
Wilhelm

Dave Rabelink
Founder/Site Admin
Founder/Site Admin
Netherlands
Posts: 3473
Joined: 24 Feb 2017, 09:12
Location: Gouda, The Netherlands

Re: SAM_Destroy on dialog boxes in 6.0 SP8

Post by Dave Rabelink » 03 Jul 2017, 06:12

Hi Wilhelm,

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)

Dialog_OnDestroyActions.zip
You do not have the required permissions to view the files attached to this post.
Regards,
Dave Rabelink

Image
Articles and information on Team Developer Tips & Tricks Wiki
Download samples, documents and resources from TD Sample Vault
Videos on TDWiki YouTube Channel

Uwe van der Horst
Site Admin
Site Admin
Germany
Posts: 621
Joined: 05 Mar 2017, 14:21
Location: Wetter (Ruhr), Germany

Re: SAM_Destroy on dialog boxes in 6.0 SP8

Post by Uwe van der Horst » 03 Jul 2017, 06:51

wilhelm wrote:
02 Jul 2017, 10:33
My base classes save position state and size of the windows at closing time.
Hi Wilhelm,

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.
Best regards,
Uwe van der Horst
stp.one

wilhelm
Germany
Posts: 283
Joined: 22 Mar 2017, 08:49
Location: Cologne

Re: SAM_Destroy on dialog boxes in 6.0 SP8

Post by wilhelm » 03 Jul 2017, 13:45

Hi guys,

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.
Cheers

Wilhelm

Return to “General Discussion TD 5.x and 6.x”

Who is online

Users browsing this forum: [Ccbot] and 0 guests