gfxgfx
 
Please login or register.

Login with username, password and session length
 
gfx gfx
gfx
1539 Posts in 509 Topics by 740 Members - Latest Member: fennellt March 02, 2021, 06:51:38 PM
*
gfx* Home | Help | Search | Login | Register | gfx
gfx
Absoft User Forum  |  Support  |  Windows  |  64-bit MRWE Child window displays incorrectly
gfx
gfxgfx
 

Author Topic: 64-bit MRWE Child window displays incorrectly  (Read 59 times)

Mike Linacre

  • Full Member
  • ***
  • Posts: 243
64-bit MRWE Child window displays incorrectly
« on: February 19, 2021, 05:36:09 AM »
Folks, can anyone help?

Am trying to migrate 32-bit MRWE code (Absoft FORTRAN 13) to 64-bit.  Here is the problem:
In 32-bit code, the MRWE Child "input/output" window has no control boxes in the title bar.
In 64-bit code, with apparently the same RegisterClass and MDICREATESTRUCT values, the MRWE Child window has control boxes which remain even when the child window is maximized.

https://docs.microsoft.com/en-us/windows/win32/winmsg/window-features says:
"You create a child window by specifying the WS_CHILD style in the CreateWindowEx function.  ...
A child window has a client area but no other features, unless they are explicitly requested."

The unchanged 64-bit MRWE code and the MRWE code with only WS_CHILD.or.WS_VISIBLE style in CreateWindowEx produced the same problematic windows. I inserted a MessageBox call to verify that the changed code was executing.

Does the current 64-bit MRWE produce correct child windows? If so, I will upgrade (despite any other hassles that will cause).

Any suggestions, anyone??

Mike Linacre

  • Full Member
  • ***
  • Posts: 243
Re: 64-bit MRWE Child window displays incorrectly
« Reply #1 on: February 20, 2021, 03:01:04 AM »
Work-around for anyone else with this Child-window problem:

In mrwe.f, resize the parent window frame after creating the child window, which will force the child window to resize:
      g_hWndChild = SendMessage(g_hWndClient,WM_MDICREATE,  NULL_HANDLE,loc(mcs))
         (other code here)
         fresult = UpdateWindow(val(g_hWndChild))
         fresult = ShowWindow (val(g_hWndChild), val(SW_SHOWNORMAL))
         fresult = UpdateWindow(val(g_hWndFrame))
         fresult= ShowWindow (val(g_hWndFrame), val(SW_SHOWMINIMIZED))
         fresult = UpdateWindow(val(g_hWndFrame))
         fresult = ShowWindow (val(g_hWndFrame), val(SW_SHOWNORMAL))
         fresult = UpdateWindow(val(g_hWndFrame))     

In frame.f,   add a message handler to the frame to force child window resizing:
        integer*8 w
        integer*2 wi(4)
        equivalence (w, wi(1)) 
        integer*4 LOWORD, HIWORD

       case (WM_DESTROY)

               call PostQuitMessage(0)
               return

             case (WM_SIZE)
                 w=lParam
                 LOWORD=wi(1)
                 HIWORD=wi(2)
c instruct the child window to resize: deliberately 1 pixel down at the top, so
c the child window is not actually maximized, but looks that way :-)
                 i = MoveWindow(g_hWndChild, 0, 1, LOWORD, HIWORD-1, false)

            case default

In child.f, child window message handler:
                case (WM_CREATE)
                (more code)
              result = ShowWindow (val(g_hWndChild), val(SW_SHOWNORMAL))   
               result = SetWindowLongPtr(WndH,  GWLP_USERDATA, p_txtInfo)
c force the child window to have the correct style
               result = SetWindowLongPtr(WndH,  GWL_STYLE, INT(WS_CHILD.OR.WS_VISIBLE,8) )

forumadmin

  • Administrator
  • Sr. Member
  • *****
  • Posts: 313
Re: 64-bit MRWE Child window displays incorrectly
« Reply #2 on: February 20, 2021, 07:48:35 AM »
Thanks for posting a solution. Can you send an email to our support staff with a screen capture that illustrates what you mean by "In 32-bit code, the MRWE Child "input/output" window has no control boxes in the title bar."? Screenshots in the MRWE chapter of the manuals show control boxes in the Input/Output child window going back to version 7.0.

Mike Linacre

  • Full Member
  • ***
  • Posts: 243
Re: 64-bit MRWE Child window displays incorrectly
« Reply #3 on: February 20, 2021, 10:08:58 PM »
Thanks Administrator :)

For everyone to see, attached are the Absoft 13 32-bit input/output child window and the 64-bit input/output child window. The 32-bit child window matches the Microsoft WS_CHILD documentation. If everyone has been happy with the 64-bit "child" window layout for 10+ years, then changing it now will cause a lot of headaches!
« Last Edit: February 20, 2021, 10:10:48 PM by Mike Linacre »

forumadmin

  • Administrator
  • Sr. Member
  • *****
  • Posts: 313
Re: 64-bit MRWE Child window displays incorrectly
« Reply #4 on: February 21, 2021, 04:34:08 PM »
Tthis is certainly curious. I am unable to duplicate the behavior you observe with 32-bit MRWE and Absoft Pro Fortran 2013 (v13.0.4).  I just performed a fresh installation and compiled the sample Fibonacci.f95 file as a 32 bit MRWE application.

Is it possible you modified your copy of 32-bit MRWE at some point? The size for C:\Absoft13.0\lib\mrwe.lib after a fresh installation of 13.0.4 is 134,988 bytes. Here is the MD5 checksum:
C:\Users\absoft> certutil -hashfile C:\Absoft13.0\lib\mrwe.lib MD5
MD5 hash of C:\Absoft13.0\lib\mrwe.lib:
0a3f5fce9f64bfbdaa39983c8d34cabe



Mike Linacre

  • Full Member
  • ***
  • Posts: 243
Re: 64-bit MRWE Child window displays incorrectly
« Reply #5 on: February 22, 2021, 07:57:28 PM »
Forumadmin, you are correct!

Reviewing the history of this FORTRAN code, it was originally written under UNIX about 1985. Then migrated to Microsoft DOS-FORTRAN about 1989. Then to Absoft Pro FORTRAN for Windows in 1997 (using the 1995 compiler: was this version 1?). There are still MRWE code segments with the Absoft 1995 copyright header. Undoubtedly the original ABSOFT MRWE code was modified to match Microsoft specifications. That code (with tweaks and bug-fixes) has survived many new versions of Absoft FORTRAN and continues to be used in the current 32-bit application.

Migrating from Absoft 32-bit to Absoft 64-bit was scheduled as a 1 month job. It now looks like a 6-month epic!

Absoft User Forum  |  Support  |  Windows  |  64-bit MRWE Child window displays incorrectly
 

gfxgfx
gfx gfx
Powered by MySQL Powered by PHP Valid XHTML 1.0! Valid CSS!