Rail Error Handling
PC*Miler Rail-Connect provides several error handling functions to help diagnose DLL operations and troubleshoot trips. These functions assist in identifying runtime issues when using your application’s interface to PCRSRV32.
All PC*Miler Rail-Connect functions return a negative number on error, with the value representing the error code. Use the PCRSGetErrorString()
function to retrieve a text description of the error code. For a list of error codes and messages, see the PC*Miler Rail-Connect Error Codes documentation.
HRESULT PCRSGetError(int *errno)
PCRSGetError()
returns the number of the last error the server encountered in the argument errno
. Constants for each possible error are defined in the pcrsdefs.h
header.
HRESULT PCRSGetErrorString(int errorCode, char *buffer, int bufSize, int *chars)
PCRSGetErrorString()
retrieves the associated error text from the DLL’s resources. It returns the number of characters copied into the buffer in the argument chars
.