- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
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.
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.
링크가 복사됨
3 응답
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
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
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
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).
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).
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
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.
