This class is only available in the RT environment. It has been derived from CIThread to ease the creation of a thread that waits for incoming handles at an object mailbox. It must be used to derive an application specific object mailbox thread class, or it can be used directly to control a thread object.
Constructor
Destructor
Create
DoForever
ExitInstance
OnReceive
The following member variable is only available to the members of the class and its derived classes:
CIObjectMbx m_Mbx;
See CIThread::Constructor.
See CIThread::Destructor.
If the object is already attached, it is first detached. Then this call creates a new active RT thread object and attaches it to the object.
DWORD CIObjectMbxThread::Create( char * pszName, char * pszMbx, BYTE byPrio, DWORD dwStack, BOOLEAN bGo );
pszName
pszMbx
byPrio
dwStack
bGo
The new thread creates the object mailbox and catalogs it. The result is a status indicating success or failure:
E_OK
E_MEM
E_LIMIT
byPrio
contains a bad value, or the object directory is full.
E_SLOT
E_PARAM
dwStack
contains a value of less than 2048, or either name is too long or is improperly formatted.
E_CONTEXT
For details on the code executed by the new thread, See CIThreadCreate.
See CIThread::DoForever. CIObjectMbxThread::DoForever is called by the framework and should never be called explicitly. CIObjectMbxThread::DoForever waits for a handle at the object mailbox (no timeout), creates an object for the handle (and optionally also one for the reply object handle), calls the OnReceive member (only after successful receive, see below) deletes the created objects and returns a boolean status (TRUE for success, FALSE for failure). When overruling this call, do not include a call to the default call.
See CIThread::ExitInstance. CIObjectMbxThread::ExitInstance is called by the framework before terminating the thread and should never be called explicitly. CIObjectMbxThread::ExitInstance detaches the object mailbox object and then returns 0.
CIObjectMbxThread::OnReceive is called by the framework when a handle has been received sucessfully and should never be called explicitly. CIObjectMbxThread::OnReceive just returns TRUE. When overruling this call, there is no need to call the default call.
BOOLEAN CIObjectMbxThread::OnReceive( CIObject * pObject, CIObject * pReply );
pObject
pReply