PC*MILER|Rail-Connect contains a number of error handling functions that can be used to diagnose the operation of the DLL as well as to troubleshoot a trip. These functions facilitate the identification of runtime problems while using your application’s interface to PCRSRV32.


All PC*MILER|Rail-Connect functions return a negative number on error, with the value being the error code. The function PCRSGetErrorString() will return a text description of the error code passed to it in the given character buffer. A brief description of error codes and messages in PC*MILER|Rail-Connect is available here



HRESULT PCRSGetError(int *errno)


PCRSGetError() returns the number of the last error the server encountered in the argument errno. There are constants defined for each of the possible errors in the header pcrsdefs.h.



HRESULT PCRSGetErrorString(int errorCode, char *buffer, int bufSize, int *chars)


PCRSGetErrorString() will get the associated error text from the DLL's resources. It returns the number of characters copied into the buffer in the argument chars.