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

Modal Dialog Box not visible

ahasan
Beginner
678 Views
I am using CVF 6.6a with Xp Home. The code I generated with Developer Studio and the Fortran Windows tempelate (Win32 APIs) displays a modal dialog box with the OK and CANCEL buttons. This code works fine on the Xp machine, but when I run it on under Win2k the dialog box and Dialog box title bar are not visible, but the OK and Cancel buttons are. If I build one of the sample programs that includes a modal dialog box from the DF98 directory on the Win2K machine, the dialog box displays normally. I created a simplified code, attached, which produces the same results as above. Any ideas or suggestions would be appreciated! Thanks.
0 Kudos
4 Replies
Jugoslav_Dujic
Valued Contributor II
678 Views
It's not compilable as-is (TestDlgGlobals are missing) (please attach a .zip with .dsw, .dsp, .rc, resource.fd, resource.h and *.f90 in the future), but the most likely cause is that return value from TestDlgProc is undefined (you should return 0 in case default). Being undefined, it's a random value which takes different values on different OSes.

Basically, when TestDlgProc returns a (random) non-zero value, it says that all the messages are handled there, including WM_PAINT and WM_NCPAINT -- that's why DefDlgProc does nothing and your dialog is not displayed.

Jugoslav
0 Kudos
ahasan
Beginner
678 Views
Thanks for the reply. Zip file attached. When compiled on my Win2K and Win98 machines the attached code displays the ABOUT dialog box (created by the Fortran Windows template) correctly, however, the dialog box created by me in the resource editor does not. The only thing that appears are the controls that were on the dialog box. On WinXP the code compiles and displays properly. Could be something simple that I am doing that is creating the problem.
0 Kudos
Jugoslav_Dujic
Valued Contributor II
678 Views
But you still didn't add
case default
   TestDlgProc=0
?
Jugoslav
0 Kudos
ahasan
Beginner
678 Views
Thanks. I understand now, and have added 'case default' to the code. The dialog box is now visible. I thought that the expression 'TestDlgProc = 0' before 'end select' was sufficient. Thank you again.

Gainesville, Virginia
0 Kudos
Reply