The thread 0x6B8 has exited with code 2 (0x2).
-
Good afternoon I got this message for the app after finished debug: The thread 0x6B8 has exited with code 2 (0x2). The program 'C:\DEV\C++\Billing\Report\Debug\Report.exe' has exited with code 2 (0x2). the 0x6B8 thread is CDialog::OnCancel, the part of code that calling OnCancel is from here: LRESULT CReportDlg::OnComplete( WPARAM, LPARAM ) { m_thrReport.Wait( INFINITE ); PostMessage( WM_CLOSE ); return S_OK; } Is it because of infinite waiting causing exited with code 2? what is code 2 mean? thank you!
-
Good afternoon I got this message for the app after finished debug: The thread 0x6B8 has exited with code 2 (0x2). The program 'C:\DEV\C++\Billing\Report\Debug\Report.exe' has exited with code 2 (0x2). the 0x6B8 thread is CDialog::OnCancel, the part of code that calling OnCancel is from here: LRESULT CReportDlg::OnComplete( WPARAM, LPARAM ) { m_thrReport.Wait( INFINITE ); PostMessage( WM_CLOSE ); return S_OK; } Is it because of infinite waiting causing exited with code 2? what is code 2 mean? thank you!
When the dialog-based MFC program exits, it usually returns the ID of the button that caused the closing, or else 2 meaning CANCEL or CLOSE and 0 meaning OK. If you want custom exit codes, override ExitInstance at application and set your own exit code.
-
When the dialog-based MFC program exits, it usually returns the ID of the button that caused the closing, or else 2 meaning CANCEL or CLOSE and 0 meaning OK. If you want custom exit codes, override ExitInstance at application and set your own exit code.
That's the answer I was looking for hours ago! Thank you kind Sir! After looking into the ressource.h-File I can confirm that it's because of the ID of the Control which lead to the end of the thread. For example: I was kinda terrified of the unknown thread-exit code 32780. Cannot look up what's this about because usually the exit codes are not as far specified. After launching my exit procedere mindlessly with my overloaded OnCancel with ID 32780 the weird exit messages kept coming. But I never thought that far. Hopefully someone will spare some time with this information. best regards