public bool GetFailedObject(int index, out NativeMethods.WSmallObject item,
bool getAssociatedError, out NativeMethods.WError error)
{
CheckContextInitialized();
// object can be inserted only when the context is stopped
if(_status != ContextStatus.Stopped) {
throw new Exception("Object can be inserted only when the context is stopped");
}
int result = NativeMethods.GetFailedObject(_contextId, index, out item);
if(result == NativeMethods.ERRORCODE_SUCCESS && getAssociatedError) {
// get the associated error
result = NativeMethods.GetError(_contextId, item.log, out error);
}
else {
error = new NativeMethods.WError();
}
return ValidResult(result);
}