Absoft User Forum

Support => Windows => Topic started by: Mike Linacre on June 22, 2021, 07:50:32 PM

Title: 64-bit MRWE problem: grey rectangle instead of active window
Post by: Mike Linacre on June 22, 2021, 07:50:32 PM
Hi folks:

Have now converted my 32-bit FORTRAN to 64-bit. Operationally, everything is now exactly the same. Even the run times are the same (I expected 64 bit to be faster). But there is one annoying difference in MRWE action. When the 32-bit MRWE window becomes active (after being hidden behind other windows), it is always populated and ready to go. This is usually the situation with the 64-bit MRWE window, but sometimes

the text window displays as an unpopulated grey rectangle. The menubar is OK. Obvious actions would not make the text window display, so I have added a routine to mrwe_textproc so that, when the user clicks on the grey rectangle,
       case (WM_LBUTTONDOWN)
           result = InvalidateRect (WndH, int(0,8), TRUE) 
           result = UpdateWindow (WndH)

this redraws the text window and it now functions correctly.

Is there any efficient way to modify 64-bit MRWE so that the text window always displays correctly?
Title: Re: 64-bit MRWE problem: grey rectangle instead of active window
Post by: Mike Linacre on October 04, 2021, 02:48:22 AM
The work-around in the previous post does not always work for solid grey child windows or child windows with distorted text characters. Dragging the bottom right corner of the window always clears the problem.

Also child windows sometimes hang. Have discovered that inserting this Windows API code just before the hang location in the code prevents the hang. A message box flashes on the screen for half a second. A little annoying but better than a hang. Choose suitable text.

i = MessageBoxTimeoutA(val(int(0,8)), val(loc(heading)), val(loc(messagetext)), val(MB_OK), 0, val(int(500,8)))
heading = "my title"//char(0)
messagetext = "my message"//char)0)

Later: have checked all the win32 APIs. Found one where a 32-bit integer had been incorrectly changed to a 64-bit integer (by me). Also my FORTRAN code now correctly compiles under Absoft 13 and Absoft 21. Result: have not seen the grey rectangle for weeks. Have kept the "message box" workaround for dialog-box hangs. Have noticed other software with the same "feature". If anyone discovers a solution please tell us.

Discovered that using both WM_TEXT and WM_CHAR to write to the screen causes conflicts, so changed the code to only use WM_CHAR.