CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
+ Reply to Thread
Results 1 to 2 of 2
  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 Lindley has much to be proud of (1500+) Lindley has much to be proud of (1500+) Lindley has much to be proud of (1500+) Lindley has much to be proud of (1500+) Lindley has much to be proud of (1500+) Lindley has much to be proud of (1500+) Lindley has much to be proud of (1500+) Lindley has much to be proud of (1500+) Lindley has much to be proud of (1500+) Lindley has much to be proud of (1500+) Lindley has much to be proud of (1500+)
    Join Date
    Oct 2007
    Location
    Fairfax, VA
    Posts
    10,861

    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.

+ Reply to Thread

Bookmarks

Posting Permissions

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



HTML5 Development Center

Click Here to Expand Forum to Full Width