Run-Time Check Failure #2 - Stack around the variable 'dlg' was corrupted.
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Run-Time Check Failure #2 - Stack around the variable 'dlg' was corrupted.

  1. #1
    Join Date
    Jul 2009
    Posts
    21

    Run-Time Check Failure #2 - Stack around the variable 'dlg' was corrupted.

    Hi guys,


    May i know why i get Run-Time Check Failure #2 - Stack around the variable 'dlg' was corrupted , When i added a browse button.Im using visual studio


    void CappendingDlg::OnBnClickedButton2()
    {

    CFileDialog wavDlg( TRUE, NULL, NULL, OFN_ALLOWMULTISELECT | OFN_HIDEREADONLY, TEXT("JPG Files(*.jpg)|*.jpg||"), this);


    if ( wavDlg.DoModal() == IDOK)
    {
    }
    {
    CString szlstfile = wavDlg.GetFileName(); // This is your selected file name with path
    }

    {
    m_save_files = wavDlg.GetFileName();
    UpdateData( FALSE );
    }

    }








    Thanks.

  2. #2
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Fairfax, VA
    Posts
    10,885

    Re: Run-Time Check Failure #2 - Stack around the variable 'dlg' was corrupted.

    Since there is no variable called "dlg" in that code snippet, we can't guess at what the problem might be.

    However, this error usually occurs because you have an array declared in the same stack frame as the variable, and you've overrun its bounds.

Posting Permissions

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


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center