CUT_ERR::GetErrorString
static const _TCHAR* GetErrorString(int err)
Parameters
err |
The enumerated error code. |
Return Value
Returns a text description of the error that has occurred. If the call is made with an err value that is out of range the string then "CUT_ERR::GetErrorString: ErrorString array improperly initialized" will be returned.
Remarks
You will usually call this method to obtain a description of an error returned from one of the client or server Ultimate TCPIP v3.0 classes. Note that you must use the CUT_ERR:: scoping preface - this is a static method of a class that is never instantiated.
Example
// test for the success/failure of a SendFile operation.
if(UTE_SUCCESS != (res = MyDerivedWSClient.SendFile("myfile.txt"))) {
#ifdef _DEBUG
cout << CUT_ERR::GetErrorString(res) << endl;
#endif
switch (res)
{
case UTE_ABORTED:
// send aborted by user
break;
case UTE_FILE_OPEN_ERROR:
// unable to open specified file
break;
case UTE_CONNECT_TERMINATED:
// remote connection terminated
break;
default:
assert(0); // should never happen...
break;
}
}