3.60 DM_SendEvent

The execution of a rule attached to an external event is registered by the application with the function DM_SendEvent.Registered means that the rule is not executed immediately, but that the external event is queued and then processed according to the dialog event mechanisms.

The event is processed by the IDM with the usual event processing algorithm which results in calling a rule with the scheme on <object> extevent <no.>.

DM_Boolean DML_default DM_EXPORT DM_SendEvent
(
  DM_ID       objectID,
  DM_Value   *eventData,
  DM_UInt     argc,
  DM_Value   *argv,
  DM_Options  options
)

Parameters

-> DM_ID objectID

This is the identifier of the object to which this external event is to be sent.

-> DM_Value *eventData

This parameter defines the external event to be triggered.

-> DM_Int argc

This parameter transfers the number of parameters (up to 16).

-> DM_Value *argv

This parameter indicates the arguments (up to 16) which the IDM passes to the rule on invocation. This vector must have the length that is specified in the argc parameter.

-> DM_Options options

The following values can be specified as options:

Option

Meaning

DMF_DontTrace

This option implies that the function call shall not be traced, if the application is started with the trace option.

DMF_Synchronous

This option can be set, if it is ensured that the function DM_SendEvent is called synchronously to the process. In this case, the function internally can work more efficiently. A synchronous call is not given, when the function is called from a signal handler, for instance.

DMF_NoCriticalSection

This option prevents the function from using a critical section on Microsoft Windows.

Return Value

DM_TRUE

External event could be put in queue.

DM_FALSE

External event could not be put in queue.

Note for Microsoft Windows

Since IDM version A.05.01.a, the function DM_SendEvent uses a critical section to ensure, that it has been completed before this function or the functionDM_QueueExtEvent is invoked once more. If one of these functions is called in a situation where a critical section is not permitted, the use of the critical section can be prevented through the option DMF_NoCriticalSection.

Attention

A thread, that carries out one of the two functions must not be canceled.

See Also

C functions DM_QueueExtEvent, DM_SendMethod

Chapter “External Events” and built-in function sendevent() in manual “Rule Language”

Resource message