Called by the framework from within a rarely overridden Run member function to exit this instance of the thread, or if a call to InitInstance fails.

virtual int ExitInstance( );

Return Value

The thread's exit code; 0 indicates no errors, and values greater than 0 indicate an error. This value can be retrieved by calling GetExitCodeThread.


Do not call this member function from anywhere but within the Run member function. This member function is used only in user-interface threads.

The default implementation of this function deletes the CWinThread object if m_bAutoDelete is TRUE. Override this function if you wish to perform additional clean-up when your thread terminates. Your implementation of ExitInstance should call the base class's version after your code is executed.


Header: afxwin.h

See Also


CWinThread Class

Hierarchy Chart


Other Resources

CWinThread Members