Home > Software engineering > The Run - Time Check Failure # 2 - Stack around the variable 'InitCtrls' was corrupted.
The Run - Time Check Failure # 2 - Stack around the variable 'InitCtrls' was corrupted.
Time:09-20
After adding this function, point closed software will pop-up prompts the Run - Time Check Failure # 2 - Stack around the variable 'InitCtrls' was corrupted. Don't know where the seams Void progress: : OnBnClickedOk () { //TODO: add the control notification handler code CStdioFile myFile. CFileException fileException; If (myFile. Open (_T (" D: \ \ new folder (5) \ \ MFCApplication11 \ \ MFCApplication11 \ \ progress. TXT "), CFile: : typeText | CFile: : modeReadWrite), & amp; FileException) { MyFile. SeekToBegin (); Cstrings vx.
While (myFile. ReadString (ag)) { M_edith. SetSel (1);//edit frame orientation to the end of the Vx. The Format (L "% s \ r \ n", vx); M_edith. ReplaceSel (ag); } } The else TRACE (" Can 't open the file % s, error=% u \ n ", _T (" D: \ \ new folder (5) \ \ MFCApplication11 \ \ MFCApplication11 \ \ progress. TXT "), fileException. M_cause); MyFile. Close (); }
CodePudding user response:
Try adding a intermediate variable
cstrings vx2; Vx2. The Format (L \ r \ n "% s", (LPCTSTR) vx); M_edith. ReplaceSel (vx2);