API Guides
>
ConceptRT 3.x
Home
Pages
ConceptRT API
Examples
ErrorsManagement/main.cpp
Error Management example to diagnose the source of an error.
#include "ConceptRTOs.h"
using namespace
ConceptRT
;
// function prototype that can be used for tracing thrown RT exception
void
OnException(
RTException
& e)
{
// put a break point here to find wich line throws an exception in your code.
if
(e.
GetErrorId
() == RT_ERROR_OUT_OF_BOUND_INDEX)
{
int
t = 0;
}
}
void
ConceptRTMain
()
{
// Code to branch a function on the event of thrown RT exception
DelegateFunction<RTException &>
delegateOnException(OnException);
RTExceptionUtils::BeforeThrowException
= &delegateOnException;
SafeArray<Int32, 10>
data;
data[10];
// line that is wrong.
}
void
ConceptRTLoadLicence
()
{
// without licence
}
Last documentation update : 27 October 2016 - Copyright © 2015 Objectis. All rights reserved.