Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Unwanted screen erasures

Brooks_Van_Horn
New Contributor I
384 Views

I wasn't getting text drawn to the screen so I went thru a detailed debugging session and found my text was getting to the screen but then getting erased. The erasure was coming here:

   ! Read and process messsages
    do while( GetMessage (mesg, NULL, 0, 0) .NEQV. .FALSE.)
       if ( DlgIsDlgMessage(mesg) .EQV. FALSE ) then
           ret = TranslateMessage( mesg )
           ret  = DispatchMessage( mesg )
       end if
    end do


This is the WinMain dispatch loop and it is not going to WinMainProc to erase the screen but just here when the screen flashes and removes all the text. Any suggestions?

 

Brooks Van Horn

0 Kudos
1 Solution
andrew_4619
Honored Contributor II
384 Views

DlgIsDlgMessage is of the logical(4) (default logical) which returns the Fortran value .TRUE. or .FALSE. The constants TRUE and  FALSE in IFWIN are of type INTEGER(BOOL). The GETMESSAGE function returns a type of INTEGER(BOOL). I refuse to think about which might be 1 or 0 in this or that implementation. If you have standards warnings on it should moan at you.

View solution in original post

0 Kudos
3 Replies
andrew_4619
Honored Contributor II
385 Views

DlgIsDlgMessage is of the logical(4) (default logical) which returns the Fortran value .TRUE. or .FALSE. The constants TRUE and  FALSE in IFWIN are of type INTEGER(BOOL). The GETMESSAGE function returns a type of INTEGER(BOOL). I refuse to think about which might be 1 or 0 in this or that implementation. If you have standards warnings on it should moan at you.

0 Kudos
Steven_L_Intel1
Employee
384 Views

Yeah, .EQV. is not defined in the standard on non-LOGICAL types. Intel Fortran will convert the values to LOGICAL depending on the setting of /fpscomp:logicals. Assuming "Enable Fortran 2003 Semantics" is not enabled (which includes /fpscomp:logicals), if DlgIsDlgMessage returns an even value it will be considered .FALSE., even if it's non-zero. The PARAMETER constant FALSE is zero, so that works out ok either way. Enabling standards warnings would alert you to the non-standard conversion.

I wrote about this a long time ago here.

It sort of reads to me as if the window with "the screen" (whatever that is) isn't processing WM_PAINT messages properly. 

0 Kudos
jimdempseyatthecove
Honored Contributor III
384 Views

You might consider obtaining the handle to the control within the dialog box that you wish to update (e.g. the handle to a text box or to a chart, bitmap, etc...), then issue the Invalidate function. Use google, search

 windows invalidate

Jim Dempsey

 

0 Kudos
Reply