📄 cthread.htm
字号:
<DD>[in] CThread object causing an exception.</DD>
<I><DT>strErrorMsg</I> </DT>
<DD>[in] String describing an exception origin.</DD>
<I><DT>nExceptionType</DT>
</I><DD>[in] Type of thrown exception.</DD>
<DT>CThreadException::UNKNOWN_ERROR </DT>
<DD>Exception origin not known.</DD>
<DT>CThreadException::CANNOT_CREATE_THREAD </DT>
<DD>WINDOWS Thread cannot be created.</DD>
<DT>CThreadException::THREAD_ALREADY_STARTED </DT>
<DD>Thread is already started.</DD>
<DT>CThreadException::CANNOT_TERMINATE_THREAD </DT>
<DD>Thread termination failed.</DD>
<DT>CThreadException::CANNOT_CREATE_NOTIFICATION_OBJECT </DT>
<DD>Internal notification error.</DD>
<DT>CThreadException::CANNOT_SIGNAL_NOTIFICATION_OBJECT </DT>
<DD>Internal notification error.</DD>
</DL>
<H3>See Also</H3>
<B><P>SetThread</B> <BR>
<B>SetType</B> </P>
<P>Back to <A HREF="#CThreadException">CThreadException</A></P>
<P><HR></P>
<P><A NAME="CThreadException__CThreadException_2"></P>
<H1>CThreadException::CThreadException</H1>
<B><P></A>CThreadException::CThreadException(CThread*</B> <I>pThread</I><B>, UINT</B> <I>nErrorMsgID</I><B>, int</B> <I>nExceptionType</I> <B>= CThreadException::UNKNOWN_ERROR) </P>
</B><P>CThreadException constructor. General CThreadException class intended to be used by CThread-derived classes. CThread-derived methods should always throw CThreadException exceptions. To distinguish the origin of thrown exceptions the user should use the type of CThreadException exception. CThread methods use predefined CThreadException types but the user may define own types in CThread-derived class. Predefined types used in CThread class are described in 'Parameters' section.</P>
<H3>Parameters</H3>
<I><DL>
<DT>pThread</I> </DT>
<DD>[in] CThread object causing an exception.</DD>
<I><DT>nErrorMsgID</I> </DT>
<DD>[in] Resource ID of the string describing an exception origin.</DD>
<I><DT>nExceptionType</DT>
</I><DD>[in] Type of thrown exception.</DD>
<DT>CThreadException::UNKNOWN_ERROR </DT>
<DD>Exception origin not known.</DD>
<DT>CThreadException::CANNOT_CREATE_THREAD </DT>
<DD>WINDOWS Thread cannot be created.</DD>
<DT>CThreadException::THREAD_ALREADY_STARTED </DT>
<DD>Thread is already started.</DD>
<DT>CThreadException::CANNOT_TERMINATE_THREAD </DT>
<DD>Thread termination failed.</DD>
<DT>CThreadException::CANNOT_CREATE_NOTIFICATION_OBJECT </DT>
<DD>Internal notification error.</DD>
<DT>CThreadException::CANNOT_SIGNAL_NOTIFICATION_OBJECT </DT>
<DD>Internal notification error.</DD>
</DL>
<H3>See Also</H3>
<B><P>SetThread</B> <BR>
<B>SetType</B> </P>
<P>Back to <A HREF="#CThreadException">CThreadException</A></P>
<P><HR></P>
<P><A NAME="CThreadException__CThreadException"></P>
<H1>CThreadException::CThreadException</H1>
<B><P></A>CThreadException::CThreadException(CThread*</B> <I>pThread</I> <B>= NULL) </P>
</B><P>CThreadException constructor. General CThreadException class intended to be used by CThread-derived classes.</P>
<H3>Parameters</H3>
<I><DL>
<DT>pThread</DT>
</I><DD>[in] CThread object causing an exception.</DD>
</DL>
<H3>See Also</H3>
<B><P>SetThread</B> </P>
<P>Back to <A HREF="#CThreadException">CThreadException</A></P>
<P><HR></P>
<P><A NAME="CThreadException__GetErrorMsg"></P>
<H1>CThreadException::GetErrorMsg</H1>
<B><P></A>CString</B> <B>CThreadException::GetErrorMsg(void) </P>
</B><P>Gets an error message describing an exception origin.</P>
<H3>Return Value</H3>
<P>Error message string describing an exception.</P>
<H3>See Also</H3>
<B><P>SetErrorMsg</P>
</B><P>Back to <A HREF="#CThreadException">CThreadException</A></P>
<P><HR></P>
<P><A NAME="CThreadException__GetLastSystemErrorMsg"></P>
<H1>CThreadException::GetLastSystemErrorMsg</H1>
<B><P></A>static CString</B> <B>CThreadException::GetLastSystemErrorMsg(DWORD</B> <I>dwSysErrorCode</I><B>) </P>
</B><P>Static method which returns the message text corresponding to the system error code. This error code should be returned by GetLastError() WINDOWS function immediately after the system error occurs.</P>
<H3>Return Value</H3>
<P>String representation of the system error code.</P>
<H3>Parameters</H3>
<I><DL>
<DT>dwSysErrorCode</I> </DT>
<DD>[in] System error code returned by GetLastError() WINDOWS function.</DD>
</DL>
<P>Back to <A HREF="#CThreadException">CThreadException</A></P>
<P><HR></P>
<P><A NAME="CThreadException__GetThread"></P>
<H1>CThreadException::GetThread</H1>
<B><P></A>CThreadException::GetThread(void) </P>
</B><P>Gets CThread object that caused an exception.</P>
<H3>Return Value</H3>
<P>CThread object that caused an exception.</P>
<H3>See Also</H3>
<B><P>SetThread</P>
</B><P>Back to <A HREF="#CThreadException">CThreadException</A></P>
<P><HR></P>
<P><A NAME="CThreadException__GetType"></P>
<H1>CThreadException::GetType</H1>
<B><P></A>int</B> <B>CThreadException::GetType(void) </P>
</B><P>Gets the type of an exception. Types used in the CThread class are described in 'Return Value' section.</P>
<H3>Return Value</H3>
<P>Predefined types that may be thrown by CThread methods are as follows:</P>
<DL>
<DT>CThreadException::UNKNOWN_ERROR </DT>
<DD>Exception origin not known.</DD>
<DT>CThreadException::CANNOT_CREATE_THREAD </DT>
<DD>WINDOWS Thread cannot be created.</DD>
<DT>CThreadException::THREAD_ALREADY_STARTED </DT>
<DD>Thread is already started.</DD>
<DT>CThreadException::CANNOT_TERMINATE_THREAD </DT>
<DD>Thread termination failed.</DD>
<DT>CThreadException::CANNOT_CREATE_NOTIFICATION_OBJECT </DT>
<DD>Internal notification error.</DD>
<DT>CThreadException::CANNOT_SIGNAL_NOTIFICATION_OBJECT </DT>
<DD>Internal notification error.</DD>
</DL>
<H3>See Also</H3>
<B><P>SetType</P>
</B><P>Back to <A HREF="#CThreadException">CThreadException</A></P>
<P><HR></P>
<P><A NAME="CThreadException__ReportError"></P>
<H1>CThreadException::ReportError</H1>
<B><P></A>int</B> <B>CThreadException::ReportError(UINT</B> <I>nType</I> <B>= MB_OK, UINT</B> <I>nMessageID</I> <B>= 0</B> <B>) </P>
</B><P>Displays an exception-error message in the standard Message Box.</P>
<H3>Return Value</H3>
<P>Message Box return value. </P>
<H3>Parameters</H3>
<I><DL>
<DT>nType</DT>
</I><DD>[in] Type of the Message Box to be displayed.</DD>
<I><DT>nMessageID</DT>
</I><DD>[in] Error message string resource ID.</DD>
</DL>
<P>Back to <A HREF="#CThreadException">CThreadException</A></P>
<P><HR></P>
<P><A NAME="CThreadException__SetErrorMsg"></P>
<H1>CThreadException::SetErrorMsg</H1>
<B><P></A>void</B> <B>CThreadException::SetErrorMsg(CString</B> <I>strErrorMsg</I><B>) </P>
</B><P>Sets an error message describing an exception origin.</P>
<H3>Parameters</H3>
<I><DL>
<DT>strErrorMsg</I> </DT>
<DD>[in] Error message string.</DD>
</DL>
<H3>See Also</H3>
<B><P>GetErrorMsg</P>
</B><P>Back to <A HREF="#CThreadException">CThreadException</A></P>
<P><HR></P>
<P><A NAME="CThreadException__SetErrorMsg_1"></P>
<H1>CThreadException::SetErrorMsg</H1>
<B><P></A>void</B> <B>CThreadException::SetErrorMsg(UINT</B> <I>nErrorMsgID</I><B>) </P>
</B><P>Sets an error message describing an exception origin.</P>
<H3>Parameters</H3>
<I><DL>
<DT>nErrorMsgID</I> </DT>
<DD>[in] Error message string resource ID.</DD>
</DL>
<H3>See Also</H3>
<B><P>GetErrorMsg</P>
</B><P>Back to <A HREF="#CThreadException">CThreadException</A></P>
<P><HR></P>
<P><A NAME="CThreadException__SetThread"></P>
<H1>CThreadException::SetThread</H1>
<B><P></A>void</B> <B>CThreadException::SetThread(CThread*</B> <I>pThread</I><B>) </P>
</B><P>Sets CThread object that caused an exception.</P>
<H3>Parameters</H3>
<I><DL>
<DT>pThread</I> </DT>
<DD>[in] CThread object that caused an exception.</DD>
</DL>
<H3>See Also</H3>
<B><P>GetThread</P>
</B><P>Back to <A HREF="#CThreadException">CThreadException</A></P>
<P><HR></P>
<P><A NAME="CThreadException__SetType"></P>
<H1>CThreadException::SetType</H1>
<B><P></A>void</B> <B>CThreadException::SetType(UINT</B> <I>nErrorMsgID</I><B>) </P>
</B><P>Sets the type of an exception. CThread-derived methods should always throw CThreadException exceptions. To distinguish the origin of thrown exceptions the user may define own types of CThreadException exceptions in the CThread-derived class. Predefined types used in CThread class are described in 'Parameters' section.</P>
<H3>Parameters</H3>
<I><DL>
<DT>nErrorMsgID</I> </DT>
<DD>[in] Exception type.</DD>
<DT>CThreadException::UNKNOWN_ERROR </DT>
<DD>Exception origin not known.</DD>
<DT>CThreadException::CANNOT_CREATE_THREAD </DT>
<DD>WINDOWS Thread cannot be created.</DD>
<DT>CThreadException::THREAD_ALREADY_STARTED </DT>
<DD>Thread is already started.</DD>
<DT>CThreadException::CANNOT_TERMINATE_THREAD </DT>
<DD>Thread termination failed.</DD>
<DT>CThreadException::CANNOT_CREATE_NOTIFICATION_OBJECT </DT>
<DD>Internal notification error.</DD>
<DT>CThreadException::CANNOT_SIGNAL_NOTIFICATION_OBJECT </DT>
<DD>Internal notification error.</DD>
</DL>
<H3>See Also</H3>
<B><P>GetType</P>
</B><P>Back to <A HREF="#CThreadException">CThreadException</A></P>
<P><HR></P>
<P><A NAME="CThread_Activity_Status_Predefined_Value"></P>
<H1>CThread Activity Status Predefined Values</H1>
<P></A></P>
<PRE>enum CThread Activity Status Predefined Values {
	THREAD_CREATED,
	THREAD_STOPPED,
	THREAD_RUNNING,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -