Oc_errormsg -18 – Rockwell Automation 1747-PCINT API Software for 1746 I/O User Manual
Page 72

6–18
Library of Routines
OC_ErrorMsg
Publication 1747-6.5.3 June 1998
OC_ErrorMsg
OC_ErrorMsg returns a descriptive text message associated with the API return
value
errcode
.
Syntax:
int OC_ErrorMsg(int errcode, char **msg);
Description:
The null-terminated message string is placed in a static buffer that is reused each time this function is called.
A pointer to this buffer is returned in
msg
.
Return Value:
Considerations:
Supported in the DOS API library and the Windows NT API library.
Example:
HANDLE
Handle;
char
*msg;
int
rc;
if (SUCCESS != (rc = OC_OpenScanner(&Handle)))
{
/* Open failed - display error message */
OCErrorMsg(rc, &msg);
printf(“Error: %s\n”, msg);
}
Name:
Description:
SUCCESS
errcode
was valid.
msg
points to corresponding error description.
ERR_OCPARAM
errcode
was invalid.
msg
points to unknown error code string.