Cisco Cisco Computer Telephony Integration Option 8.5 Developer's Guide

Page of 506
   
7-4
CTI OS Developer’s Guide for Cisco Unified Contact Center Enterprise
Release 8.5(1)
Chapter 7      CtiOs Object
Methods
.NET: rArg
An output parameter containing the value of the specified element. This parameter is null if the 
element is not found.
Return Value
An Arg reference containing the value of the desired element.
The C++ and Java versions of this method return NULL if an error occurs, such as the key or element is 
not found. The .NET version of this method returns true upon success and false upon error.
GetLastError (Java and .NET only)
The GetLastError method returns the last error that occurred on the calling thread.
Syntax
Java:
Integer GetLastError()
.NET:
System.Boolean GetLastError(out System.Int32 nLastError)
Parameters
Java: None.
.NET: nLastError
Output parameter that is a 32-bit signed integer that contains the returned value of the last error.
Returns
Java:An Integer object containing the error, or null if the object is not found or if there is an error.
.NET:The Boolean value true if the value is successfully set; otherwise false.
Remarks
The following example code gets the last error on the current thread and logs the error message. If 
GetLastError fails, the code writes a warning message to the log file.
// First get the last error System.Int32 myLastError; 
bool success = GetLastError(out myLastError); 
if (!success) 
// log a message indicating that GetLastError failed 
else 
//log a message that indicates what the last error was 
LOGBYID(Cisco.CtiOs.Cil.TraceLevel.WARN, “GetLastError returned 
last error =” + myLastError); 
}