Click here to Skip to main content
15,914,410 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Stuctures and pointer Pin
Todd Smith11-Aug-02 21:01
Todd Smith11-Aug-02 21:01 
GeneralRe: View to Dialog Box Pin
Ancient Dragon11-Aug-02 17:07
Ancient Dragon11-Aug-02 17:07 
GeneralRe: View to Dialog Box Pin
Solero11-Aug-02 18:31
Solero11-Aug-02 18:31 
GeneralRe: View to Dialog Box Pin
Ancient Dragon11-Aug-02 22:57
Ancient Dragon11-Aug-02 22:57 
GeneralEndDialog and CDialog::OnOK() Pin
nss11-Aug-02 13:48
nss11-Aug-02 13:48 
GeneralRe: EndDialog and CDialog::OnOK() Pin
Ravi Bhavnani11-Aug-02 13:55
professionalRavi Bhavnani11-Aug-02 13:55 
GeneralRe: EndDialog and CDialog::OnOK() Pin
Michael Dunn11-Aug-02 14:09
sitebuilderMichael Dunn11-Aug-02 14:09 
GeneralRe: EndDialog and CDialog::OnOK() Pin
Ravi Bhavnani11-Aug-02 14:15
professionalRavi Bhavnani11-Aug-02 14:15 
nss wrote:
Which is the preferred way to terminate the modal dialog?

I just realized my thesis didn't include an answer to your question. I suggest using CDialog::OnOK() or CDialog::OnCancel(), unless you need to return a custom return value, in which case use EndDialog().

You typically do the latter when you have more than one button that ends the dialog, and you want to inform the caller which button the user clicked. For example:
CMyDialog dlg (this);
long nStatus = dlg.DoModal();
switch (nStatus) {
  case IDOK:  // user clicked "OK"
    doOkHandling();
    break;
  case IDCANCEL: // user clicked "Cancel"
    doCancelHandling();
    break;
  case ID_SomethingElse:  // user clicked "Something Else"
    doSomethingElseHandling();
    break;
  default:
    ASSERT (FALSE);  // Error!
    break;
}
/ravi

Let's put "civil" back into "civilization"
http://www.ravib.com
ravib@ravib.com
GeneralCArray and memory allocation Pin
Space Ace11-Aug-02 12:50
Space Ace11-Aug-02 12:50 
GeneralRe: CArray and memory allocation Pin
Ravi Bhavnani11-Aug-02 13:00
professionalRavi Bhavnani11-Aug-02 13:00 
GeneralRe: CArray and memory allocation Pin
Christian Graus11-Aug-02 13:03
protectorChristian Graus11-Aug-02 13:03 
GeneralRe: something like Find function? Pin
Masaaki Onishi11-Aug-02 19:58
Masaaki Onishi11-Aug-02 19:58 
GeneralRe: CArray and memory allocation Pin
Joel Lucsy12-Aug-02 3:05
Joel Lucsy12-Aug-02 3:05 
Questionwhats does it mean anyway? to translate? Pin
nss11-Aug-02 11:56
nss11-Aug-02 11:56 
AnswerRe: whats does it mean anyway? to translate? Pin
Ravi Bhavnani11-Aug-02 11:59
professionalRavi Bhavnani11-Aug-02 11:59 
GeneralRe: whats does it mean anyway? to translate? Pin
nss11-Aug-02 12:11
nss11-Aug-02 12:11 
QuestionPreTranslate message - wil it interfere? Pin
nss11-Aug-02 11:36
nss11-Aug-02 11:36 
AnswerRe: PreTranslate message - wil it interfere? Pin
Neville Franks11-Aug-02 11:43
Neville Franks11-Aug-02 11:43 
AnswerRe: PreTranslate message - wil it interfere? Pin
Michael Dunn11-Aug-02 11:54
sitebuilderMichael Dunn11-Aug-02 11:54 
GeneralRe: PreTranslate message - wil it interfere? Pin
nss11-Aug-02 11:59
nss11-Aug-02 11:59 
GeneralRe: PreTranslate message - wil it interfere? Pin
Ravi Bhavnani11-Aug-02 12:04
professionalRavi Bhavnani11-Aug-02 12:04 
GeneralRe: PreTranslate message - wil it interfere? Pin
nss11-Aug-02 12:13
nss11-Aug-02 12:13 
GeneralRe: PreTranslate message - wil it interfere? Pin
Ravi Bhavnani11-Aug-02 12:27
professionalRavi Bhavnani11-Aug-02 12:27 
GeneralRe: PreTranslate message - wil it interfere? Pin
nss11-Aug-02 12:43
nss11-Aug-02 12:43 
GeneralRe: PreTranslate message - wil it interfere? Pin
Ravi Bhavnani11-Aug-02 12:44
professionalRavi Bhavnani11-Aug-02 12:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.