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

Edit controls and Windows XP Service Pack 2

borisk
Beginner
892 Views
Since I installed windows XP Service Pack 2, edit controls in dialogs of my Visual fortran applications can no longer be modified (arrow and delete keys work, but no text/numbers can be entered).The simplest way of observing the bug is to create a dialog based sample code application using the application wizzard, to add an edit control to the dialog in the resource editor and to open two instances of the dialog: eg in the WinMain
Code:
    ghInstance = hInstance
    ghModule = GetModuleHandle(NULL)
    ghwndMain = NULL
    lret = DlgInit(IDD_dlgtest_DIALOG, gdlg)
    if (lret == .FALSE.) goto 99999
    lret = DlgInit(IDD_dlgtest_DIALOG, gdlg2)
    if (lret == .FALSE.) goto 99999
    lret = DlgSetSub(gdlg, IDD_dlgtest_DIALOG, dlgtestSub)
    lret = DlgSetSub(gdlg, IDM_APPLY, dlgtestApply)
    lret = DlgModeless(gdlg, nCmdShow)   
    if (lret == .FALSE.) goto 99999
    lret = DlgModeless(gdlg2, nCmdShow,gdlg%hwnd)
    if (lret == .FALSE.) goto 99999

with gdlg2 defined as a global variable of type dialog.None of the edit controls will be editable. If you close the child dialog, the edit control of the parent becomes editable.

Does anyone know of a reason for such behaviour, a workaround or a fix ?

0 Kudos
7 Replies
borisk
Beginner
892 Views
To be more precise, in the previous example if you try editing the content of the edit control of the child dialog first, you'll be able to do so, but if you try editing the edit control of the parent control first, then none of the edit controls will respond until you close the child dialog.
0 Kudos
Jugoslav_Dujic
Valued Contributor II
892 Views
Don't know what happened there, and I don't have a XP handy. However, does it perhaps work with this message loop?:
Code:
DO WHILE( GetMessage(Mesg,NULL,0,0) .NEQV. .FALSE.)
      hActive=GetActiveWindow()
      iStyle=GetWindowLong(hActive,GWL_EXSTYLE)
      IF (IAND(iStyle,WS_EX_CONTROLPARENT).NE.0) THEN
            IF (.NOT.IsDialogMessage(hActive, Mesg)) THEN
                  iSt=TranslateMessage(Mesg)
                  iSt=DispatchMessage(Mesg)
            END IF
      ELSE
            iSt=TranslateMessage(Mesg)
            iSt=DispatchMessage(Mesg)
      END IF
END DO
If it does, it means something is broken with DlgIsDlgMessage... in any case, please attach a complete zipped workspace and I'll (try to) take a look.
Jugoslav
0 Kudos
borisk
Beginner
892 Views
I haven't tried the message loop you suggested with service pack 2 yet since I had to unsintall SP2 to be able to continue my work (because of the aforementioned bug).
I'll try it when I have a spare couple of hours to install/uninstall sp2.
In the meanwhile here's the (really basic) project which causes the bug with WinXP SP2 (it works perfectly well with XP SP1).
0 Kudos
Steven_L_Intel1
Employee
892 Views
I tried it on my SP2 system and couldn't detect a problem. I could enter text into either of the boxes. What should I be seeing?
0 Kudos
borisk
Beginner
892 Views
As described in the second message, with SP2 installed, if I try entering text in the edit control of the parent dialog before I enter text in the child dialog, none of the edit controls responds.
This works fine on your xp sp2 system ?
0 Kudos
Jugoslav_Dujic
Valued Contributor II
892 Views
...but I don't see from earlier messages which Visual Fortran? Intel or Compaq?
Jugoslav
0 Kudos
Steven_L_Intel1
Employee
892 Views
No - I could enter text in either edit control in either order on my SP2 system.
0 Kudos
Reply