Highlighted
Absent Member.
Absent Member.
608 views

[archive] Threads And Display Message Box

[Migrated content. Thread originally posted on 11 September 2006]

I have implemented threading in our application for the display of various diary reminders etc. This thread is started as the application begins and gives the focus back to the main thread. The diary process(es) use an accept before time so that they can update their data and screen display (without getting focus). All works fine it would seem UNTIL the main thread does a DISPLAY MESSAGE BOX- this seems to default to Modal and gives me some strange behaviour, sometimes the diary thread gets focus yet the main thread still sometimes receives the mouse/keyboard input and various other combinations of trouble (I think dependent on the sequence of events in the two threads).

Is there any way to get around this? or to use the message box as a modeless window?

Keith
0 Likes
2 Replies
Highlighted
Absent Member.
Absent Member.

RE: [archive] Threads And Display Message Box

You cannot use DISPLAY MESSAGE BOX like you do. DISPLAY MESSAGE BOX invokes a Windows API function which effectively freeze COBOL threads. Do your own message box using standard COBOL windows to circumvent this.
For an example of a self implemented message box, see the custrpt.cbl sample program and the cancel.cbl
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Threads And Display Message Box

Yep - I thought that would be the answer. Thanks for the response.
Keith
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.