A Commodities Exchange function that acts on a cxobject records errors in the CxObject's accumulated error field. The function cxobjerror() returns a CxObject's error field. co_errorfield = LONG CxObjError( CxObj *co ); Each bit in the error field corresponds to a specific type of error. The following is a list of the currently defined cxobject errors and their corresponding bit mask constants. Error Constant Meaning -------------- ------- COERR_ISNULL cxobjerror() was passed a null. COERR_NULLATTACH Someone tried to attach a NULL cxobject to this CxObject. COERR_BADFILTER This filter cxobject currently has an invalid filter description. COERR_BADTYPE Someone tried to perform a type specific function on the wrong type of cxobject (for example calling setfilter() on a sender cxobject). The remaining bits are reserved for future use. hotkey.c checks the error field of its filter cxobject to make sure the filter is valid. HotKey.c does not need to check the other objects with cxobjerror() because it already makes sure that these other objects are not NULL, which is the only other kind of error the other objects can cause in this situation. Commodities Exchange has a function that clears a cxobject's accumulated error field, clearcxobjerror(). void ClearCxObjError( CxObj *co ); A commodity should be careful about using this, especially on a filter. If a commodity clears a filter's error field and the COERR_BADFILTER bit is set, Commodities Exchange will think that the filter is OK and start sending messages through it.