This function fills a message buffer with the text corresponding to the passed error number. A filter string with the name of the PI-API function that produced the error number may be passed. In that case, this function will resolve the message to one message. Otherwise, multiple messages may be returned for a given error number until PI_NOMOREVALUES is returned.

Visual Basic format

Declare Function piut_strerror Lib "piapi32.dll" (
ByVal stat&,
ByVal Msg$,
ByVal SrcStr$) As Long

C format

int32 PIPROC piut_strerror(
int32 stat,
size_t PIPTR *msglen,
TCHAR PIPTR *filter);




No more messages for this errornumber.(PI_NOMOREVALUES)

Success (more text messages available).


String truncated


Length specified for buffer is too small.


Null pointer passed for arguments.



stat (passed)

Error code.

msg (modified)

Buffer in which to copy the message.

msglen (passed, modified)

Size in bytes of buffer on input, number of bytes copied into buffer on return.

filter (passed)

PI-API function call which generated the message.

Usage Notes

For error numbers such as -1 the meaning varies according to which PI-API function was called. Calling this function without a filter string will return all the messages in the list of -1 errors for the PI-API, one at a time. Repeated calls with the same error number will retrieve the next message in the list for that error number until after the last message. For the call after the last, PI_NOMOREVALUES will be returned and then will restart at the beginning of the list. Changing the error number passed will automatically begin at the beginning of the list for a given error number.

If a filter string is passed, only one message will be returned.

Enabling Operational Intelligence