API ' event method Private Sub evtLogger_OnLoggedEventsCleared() Debug.Print "Logged Event are cleared!" End Sub 9.3.5.7 OnClearEvent _ITcEventLogEvents [ } 144] This event method is called on all clients that implement and connect this event interface when an event is cleared. This method is called on all events for one source id after a call of the PLC function block ADSCLEAREVENTS with the iMode set to TCEVENTLOGIOFFS_CLEAREVENTSRCID. HRESULTOnClearEvent(ByVal evtObj As Object); Parameters evtObj [in] IDispatch pointer to a new event object of the class TvEvent. The event object provides the full access to the cleared event.
Each client receives a reference to the event object and no copy. S_OK Function was successfully called Visual Basic sample code Option Explicit Dim WithEvents evtLogger As TCEVENTLOGGERLib.TcEventLog ' form load Private Sub Form_Load() ' get the one and only event logger Set evtLogger = New TcEventLog End Sub ' event method Private Sub evtLogger_OnClearEvent(ByVal evtObj As Object) Dim evt As TcEvent Set evt = evtObj ' print the message string in English Debug.Print evt.GetMsgString(1033) End Sub 9.3.5.8 OnShutdown _ITcEventLogEvents [ } 144] This event method is called when the operating system shuts down. This could be used by DCOM clients to release the connection.
HRESULTOnShutdown([in] VARIANT shutdownParm); Parameters shutdownParm [in] A variant that describes the shutdown reason (in our case always REASON_SYSSHUTDOWN). The items of the array are explained in the following table. TcEventLogger 149 Version: 1.1