Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. CFileDialog::DoModal() crashing with "stack overflow"

CFileDialog::DoModal() crashing with "stack overflow"

Scheduled Pinned Locked Moved C / C++ / MFC
c++data-structureshelpquestion
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    chesky
    wrote on last edited by
    #1

    The following code exists in identical form in two projects. (A dialog box & its logic were created in a test framework, then moved over to the final project.) In one project, this works fine, in the second I get "Unhandled exception at 0x763b1fda in AtasMod.exe: 0xC00000FD: Stack overflow." void CSpecialEventDlg::OnBnClickedSpecialEventBrowse() { CFileDialog oDlg(true, ".wav", 0, OFN_HIDEREADONLY, "Sound Files (*.wav)|*.wav||"); // taking the next line out changes nothing oDlg.m_pOFN->lpstrTitle = "Find Sound File"; if (oDlg.DoModal() == IDOK) { // do stuff } } I've traced the code into MFC, and the crash is occurring in dlgfile.cpp: OPENFILENAME& CFileDialog::GetOFN() { return *m_pOFN; // this line crashes } Am I doing something wrong? Is there some way to avoid the problem? Thanks, all, --chesky

    C 1 Reply Last reply
    0
    • C chesky

      The following code exists in identical form in two projects. (A dialog box & its logic were created in a test framework, then moved over to the final project.) In one project, this works fine, in the second I get "Unhandled exception at 0x763b1fda in AtasMod.exe: 0xC00000FD: Stack overflow." void CSpecialEventDlg::OnBnClickedSpecialEventBrowse() { CFileDialog oDlg(true, ".wav", 0, OFN_HIDEREADONLY, "Sound Files (*.wav)|*.wav||"); // taking the next line out changes nothing oDlg.m_pOFN->lpstrTitle = "Find Sound File"; if (oDlg.DoModal() == IDOK) { // do stuff } } I've traced the code into MFC, and the crash is occurring in dlgfile.cpp: OPENFILENAME& CFileDialog::GetOFN() { return *m_pOFN; // this line crashes } Am I doing something wrong? Is there some way to avoid the problem? Thanks, all, --chesky

      C Offline
      C Offline
      CodeBrain
      wrote on last edited by
      #2

      Use oDlg.m_ofn.lpstrTitle = "Find Sound File"; I don't know what the pOFN Pointer you are using does exactly...

      C 1 Reply Last reply
      0
      • C CodeBrain

        Use oDlg.m_ofn.lpstrTitle = "Find Sound File"; I don't know what the pOFN Pointer you are using does exactly...

        C Offline
        C Offline
        chesky
        wrote on last edited by
        #3

        > Use > oDlg.m_ofn.lpstrTitle = "Find Sound File"; > I don't know what the pOFN Pointer you are using does exactly... I'll try that, but as I wrote earlier, taking the entire line out had no effect - it worked the same in one project, and crashed the same in the other.

        C 1 Reply Last reply
        0
        • C chesky

          > Use > oDlg.m_ofn.lpstrTitle = "Find Sound File"; > I don't know what the pOFN Pointer you are using does exactly... I'll try that, but as I wrote earlier, taking the entire line out had no effect - it worked the same in one project, and crashed the same in the other.

          C Offline
          C Offline
          chesky
          wrote on last edited by
          #4

          >> Use >> oDlg.m_ofn.lpstrTitle = "Find Sound File"; >> I don't know what the pOFN Pointer you are using >> does exactly... >> > I'll try that, but as I wrote earlier, taking the > entire line out had no effect - it worked the same > in one project, and crashed the same in the other. > Tried it, changed nothing - does anyone have any ideas? --chesky

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups