CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 9 of 9

Thread: Any suggestion

  1. #1
    Join Date
    Apr 1999
    Posts
    121

    Any suggestion

    Any suggestion on how to not continue if the ID is equal to IDNO?
    Thank you

    void CDlgQuestionPath::OnOK()
    {
    UpdateData(TRUE); //Will update all existing variables.
    CString destPath = GetQuesPath();
    Path path(ToString(destPath));
    if (!path.IsDirect()){
    int iResponse = AfxMessageBox(IDS_WARN_NODIRECTORYEXIST, MB_YESNO|MB_ICONQUESTION);
    if(iResponse == IDYES) {
    Directory dir(ToString(destPath));
    dir.Create();
    }
    else{
    ***suggestion on what to do here**
    }
    }

    CDialog::OnOK();
    }



  2. #2
    Join Date
    May 1999
    Location
    Atlanta, GA, USA
    Posts
    443

    Re: Any suggestion

    Hi, Sophie.

    As for me, if I use YesNo MessageBox,
    I remove all input which it get by Yes button and set focus to
    some edit box when I click No button.

    Regards.
    -Masaaki Onishi-


  3. #3
    Join Date
    May 1999
    Location
    Sydney, Australia
    Posts
    420

    Re: Any suggestion

    // This is my suggestion

    void CDlgQuestionPath::OnOK()
    {
    UpdateData(TRUE); //Will update all existing variables.
    CString destPath = GetQuesPath();
    Path path(ToString(destPath));
    if (!path.IsDirect()){
    int iResponse = AfxMessageBox(IDS_WARN_NODIRECTORYEXIST, MB_YESNO|MB_ICONQUESTION);
    if(iResponse == IDYES) {
    Directory dir(ToString(destPath));
    dir.Create();
    CDialog::OnOK();
    }
    }
    }




  4. #4
    Join Date
    Apr 1999
    Posts
    16

    Re: Any suggestion

    else{
    ***suggestion on what to do here**
    return;
    }


    WBR Oak

  5. #5
    Join Date
    Apr 1999
    Posts
    121

    Re: Any suggestion

    Good suggestion. But now if I try to use a directory that already exist it doesn't work. It only works when it is a new directory.

    Any other suggestion!
    Thanks


  6. #6
    Join Date
    May 1999
    Location
    Atlanta, GA, USA
    Posts
    443

    Re: Any suggestion

    Hi, Sophie.

    My previous post seems to be out of scope?
    When you use YesNo message box, you should show something.
    In this case, you must show the directory name and location.
    Otherwise, this messagebox makes no sense.

    HTH.
    -Masaaki Onishi-


  7. #7
    Join Date
    May 1999
    Location
    Sydney, Australia
    Posts
    420

    Re: Any suggestion

    can you give me a bit more detail of what the program at large is doing
    and also what you plan to do with the existing directory and how you do that?

    Sally


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured