beckhoff — 9.3.1.6 EnumLoggedEvents

API ' print the event message in english Debug.Print evt.GetMsgString(1033) ' release the evt object Set arrEvt(i) = Nothing Next i Loop While (nFetched >= coMax) Remarks The behaviour of the imported TcEventLogger type libraries is different under CodeGear C++Builder 2009 and Visual Studio C++. Both development environments generate different Code. In C++Builder the returned enumeration object is not automatically enabled if it leaves the visible range ("out of scope" ) e.g. after allocation: ITcEnumEventsPtr enumEvt = evtLogger->EnumActiveEvents(); the no longer used object must be enabled in C++Builder.

enumEvt->Release(); There is no difference to the Microsoft Visual Studio C++ implementation. The release call is not necessary. For this please use the EnumActiveEventsEx () method in C++Builder. This method enables the returned object under C++Builder automatically. 9.3.1.5 EnumLoggedEventsEx ITcEventLog [ } 129] Returns an enumeration object that is used to iterate through the list of active events. This Method is provided for compatibility with the .NET language family. If you are programming in C++ you might rather want to use the previous version : EnumActiveEvents [ } 132] .

HRESULTEnumLoggedEventsEx([out,retval] ITcEnumEventEx** ppEnum); Parameters ppEnum [out, retval] Pointer to the ITcEnumEventsEx [ } 155] interface pointer that receives the enumeration object of the active events. Return Values S_OK Function was successfully called E_POINTER ppEnum was no valid pointer. Visual Studio 2005 C# Sample Code : foreach(TcEventevtinnewTcEventLog().EnumActiveEventsEx()) evt.Reset(); Also see about this 2 ITcEnumEvents [ } 150] 9.3.1.6 EnumLoggedEvents ITcEventLog [ } 129] TcEventLogger 133 Version: 1.1