When an error occurs within a class method and that method subsequently fails, the calling procedure can retrieve the error code for that failed method call by using the wpclsQueryError method. Note that the error code is always that of the last method that failed. A successful method does not modify the error code held within a class object. This method is analogous to the WinGetErrorInfo and the WinGetLastError function calls that are used by Presentation Manager applications to diagnose the reason for the previous failing call to a Presentation Manager function call.
The system-provided class methods will return error codes as defined in the header file PMERR.H. For example, the wpclsQueryObject method will normally log an error of WPERR_OBJECT_NOT_FOUND if it is unable to return an object pointer.