# xxxAddRTC

Invoked by the dispatcher into a provider service when an RTC condition and action is set up involving events from the service.

#### Prototype

DWORD xxxAddRTC (CTAHD ctahd, void *mgrcontext, RTC_CONDITION *pcondition, RTC_ACTION *paction )

Argument | Description
ctahd | Handle to a Natural Access context.
mgrcontext | Context pointer allocated when service manager opened.
pcondition | Pointer to an RTC_CONDITION structure describing the RTC condition: typedef struct _RTC_CONDITION { RTC_ATTRIBUTES Attribute; /*Characteristics of RTC condition */ DWORD EventID; /* Service's event ID for condition */ DWORD EventValue; /* Specific value sent with the event.*/ /* Used with Attribute RTC_WITH_VALUE */ char Alias[ RTC_NAME_LEN ]; /* ASCII name of RTC condition */ } RTC_CONDITION;
paction | Pointer to an RTC_ACTION structure describing the RTC action: typedef struct _RTC_ACTION { DWORD Consumer; /* Service ID of RTC consumer */ DWORD ActionCmd; /* Special command sent to service on */ /* recognition of condition */ } RTC_ACTION;

#### Return values

Return value | Description
SUCCESS | Dispatcher to send RTC action to RTC consumer.
Any service-specific error |

#### Details

xxxAddRTC is invoked by the dispatcher into a provider service when an RTC condition and action is set up involving events from the service.

The function is invoked in the following cases:

- A consumer service successfully registered a condition and action pair using dispAddRTC, where the condition involves one of the provider service's events.

- The provider service added an alias for one or more of its events to the database using dispRegisterRTCAlias, and a consumer service has successfully registered a condition and action pair using dispAddRTC, where the condition involves the alias.

In either case, the dispatcher waits until the provider service is open on the context before invoking xxxAddRTC.

Any error returned from this binding function is returned back to the calling service.

#### See also

dispRemoveRTC, xxxRemoveRTC