RegisterCommEvent

This member function registers an application object to receive notification of all communication link connect/disconnect events. To use this function, the application must create an object derived from the ECLCommNotify class. A pointer to that object is then passed to this registration function. Implementation Restriction: An application can register only one object for communication event notification.

After a notify object has been registered with this function, it will be called whenever the connections communication link with the host connects or disconnects. The object will receive notification for all communication events whether they are caused by the StartCommunication() function or explicitly by the user. This event should not be confused with the connection start/stop event which is triggered when a new ZIEWin connection starts or stops.

The optional InitEvent parameter causes an initial event to be generated when the object is registered. This can be useful to synchronize an event object with the current state of the communications link. If InitEvent is specified as FALSE, no initial event is generated when the object is registered. The default for this parameter is TRUE.

The application must call UnregisterCommEvent() before destroying the notification object. The object is automatically unregistered if the ECLConnection object where it is registered is destroyed.

See the description of ECLCommNotify Class for more information.