![]() | Programming Guide | ![]() |
Gets the error code returned by the last properties API function call
#include <smuprapi.h>int sm_prop_error(void);
- · 0: The last function call succeeded.
- ·
PR_E_ERROR: Failed for another reason.
- ·
PR_E_MALLOC: Insufficient memory.
- ·
PR_E_OBJID: Object ID does not exist.
- ·
PR_E_OBJECT: Object does not exist.
- ·
PR_E_ITEM: Invalid occurrence or element.
- ·
PR_E_PROP: Invalid property.
- ·
PR_E_PROP_ITEM: Invalid property item.
- ·
PR_E_PROP_VAL: Invalid property value.
- ·
PR_E_CONVERT: Unable to perform conversion.
- ·
PR_E_OBJ_TYPE: Invalid object type.
- ·
PR_E_RANGE: Property value is out of range.
- ·
PR_E_NO_SET: Property cannot be set.
- ·
PR_E_BEYOND_SCREEN: Widget extends beyond screen.
- ·
PR_E_WW_SCROLLING: Word wrap must be scrolling.
- ·
PR_E_NO_SYNC: Arrays cannot be synchronized.
- ·
PR_E_TOO_BIG: Widget too large for screen.
sm_prop_errorgets the error code returned by the last-called properties API function: sm_prop_get, sm_prop_set, sm_prop_id, or one of their variants. This function is especially useful for ascertaining the success or failure of calls to variants that do not return an error code—for example,sm_prop_get_str, which returns 0 when an error occurs.Because Panther internal processing also uses the properties API, you should call this function and retrieve the desired error code immediately.
Note: A negative value returned by
sm_prop_get_intand its variants usually specifies an error. However, some integer properties accept negative values; in these cases, you can differentiate between a negative property value and an error condition only by callingsm_prop_error.
/* Act on error code */
switch (sm_prop_error())
{
case '0':
...
break;
case PR_E_ERROR:
...
break;
case PR_E_MALLOC:
...
break;
...
default:
...
}
![]()
![]()
![]()
![]()