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

Dialog proc. question.

dzuba
초급자
664 조회수
Hello!

I created modal dialog this way:
flag = dlginit(IDD_DIALOG1,InfoDialog)
flag = DlgSetSub(InfoDialog, IDD_DIALOG1, MyCallbackFunction)
flag = DlgModal(InfoDialog, i)

I added a button to a dialog with VS Resource Editor.
If I click on it - the dialog box disapears!
WHY ?!


If I am trying to make modeless dialog:
flag = DlgModeless(InfoDialog, i, ghwndMain)
It not apears at all (or maybe apears and disapears quickly).
WHY ? How can I show modeless dialog?

The project is Single document Win32 application.

Thanks.
0 포인트
3 응답
anthonyrichards
새로운 기여자 III
664 조회수

The message from any control not assigned a call-back using DLGSETSUB will be handled by the default dialog procedure, which in my experience does just what you observe - it closes the box. So make re you assign the button a call-back.

Also, if you are using call-backs, use DLGMODAL(dlg), without the second argument.

You do not use call-backs with a modeless dialog. A modeless dialog requires a message loop and a dialog procedure to handle the messages.

Message Edited by anthonyrichards on 03-01-2006 09:03 AM

0 포인트
Jugoslav_Dujic
소중한 기여자 II
664 조회수
You do not use call-backs with a modeless dialog. A modeless dialog requires a message loop and a dialog procedure to handle the messages.

This statement is ambiguous at best, and incorrect at worst.

A modeless dialog handled with DFLOGM can have callbacks, and they work the same way as in modal dialog. The only difference in this regard is that button without the callback does not close the dialog. (And I find that behavior of modal dialogs questionable).

A modeless dialog handled with DFLOGM does require a message loop, but if you're in a GUI application (or QuickWin's menu callback) the message loop is already there. It does not require a separate dialog procedure, as DFLOGM, of course, provides one (and, btw, it's the same as the one of modal dialogs, with few if's here and there to adjust modal/modeless behavior).
0 포인트
anthonyrichards
새로운 기여자 III
664 조회수
Yes, well Jugoslav I did modify that statement later and include the CVF example code which shows a loop and callbacks being used with a modeless box. I thought I had posted the edited message, but it seems to have failed to get through.
0 포인트
응답