Retrieves the original name of the fired event.
Type | Description | |||
String | A string expression that indicates the event's name. |
The Name property indicates the name of the event. Use the ID property to specify a specified even by its identifier. Use the ToString property to display information about an OLE event. The ToString property displays the identifier of the event after the name of the event in two [] brackets. For instance, the ToString property gets the "KeyDown[-602](KeyCode/Short* = 9,Shift/Short = 0)" when TAB key is pressed, so the identifier of the KeyDown event being fired by the inside User editor is -602. The following VB sample shows how to enumerate the arguments of an OLE event:
Private Sub Record1_UserEditorOleEvent(ByVal Object As Object, ByVal Ev As EXRECORDLibCtl.IOleEvent, ByVal Ed As EXRECORDLibCtl.IEditor) On Error Resume Next Debug.Print "Event name: " & Ev.Name If (Ev.CountParam = 0) Then Debug.Print vbTab & "The event has no arguments." Else Debug.Print "The event has the following arguments:" Dim i As Long For i = 0 To Ev.CountParam - 1 Debug.Print vbTab & Ev(i).Name; " = " & Ev(i).Value Next End If End Sub
The following VC sample enumerates the arguments of an OLE event:
void OnUserEditorOleEventRecord1(LPDISPATCH Object, LPDISPATCH Ev, LPDISPATCH Ed) { EXRECORDLib::IOleEventPtr spEvent = Ev; CString strOutput = "Event name: "; strOutput += spEvent->Name; strOutput += "\r\n"; if ( spEvent->CountParam == 0 ) { strOutput += "\tThe event has no arguments."; } else { strOutput += "\tThe event has no arguments.\r\n"; for ( long i = 0; i < spEvent->CountParam; i++ ) { strOutput += spEvent->GetParam( v(i) )->Name; strOutput += " = "; strOutput += V2S( &spEvent->GetParam( v(i) )->Value); strOutput += "\r\n"; } } m_output = strOutput; UpdateData( FALSE ); }
The #import "c:\winnt\system32\ExRecord.dll" generates the EXRECORDLib namespace that includes definitions for OleEvent and OleEventParam objects.