CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 1999
    Posts
    16

    Common Dialog Failure

    Hi, I am just trying to open up a common dialog box, but it seems to sometimes close my program.

    //Construct a file filter for the common dialog box
    static char BASED_CODE szFilter[] = "HTML Files (*.htm)|*.htm|All Files (*.*)|*.*||";

    //Open up a "Save As" commond dialog
    CFileDialog cfd(FALSE, "htm", csSession, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, szFilter, NULL);

    //If they cancelled lets get out of here
    cfd.DoModal();




    When I call the DoModal my program closes out. It is an SDI MFC app.


  2. #2
    Join Date
    May 1999
    Location
    Texas, USA
    Posts
    568

    Re: Common Dialog Failure

    Check out what csSession is and make sure it is valid. I changed it to NULL and your code worked fine.

    Wayne


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