Type | Description | |||
EventID as Long | A Long expression that specifies the identifier of the event. Use the EventParam(-2) to display entire information about fired event ( such as name, identifier, and properties ). |
This is useful for X++ language, which does not support event with parameters passed by reference.
In X++ the "Error executing code: FormActiveXControl (data source), method ... called with invalid parameters" occurs when handling events that have parameters passed by reference. Passed by reference, means that in the event handler, you can change the value for that parameter, and so the control will takes the new value, and use it. The X++ is NOT able to handle properly events with parameters by reference, so we have the solution.The solution is using and handling the Event notification and EventParam method., instead handling the event that gives the "invalid parameters" error executing code.
Here's how the output is shown, when printing the EventParam(-2) during the Event event:
BrowseItem/11( [Object] ) MouseMove/-606( 0 , 0 , 15 , 139 ) MouseDown/-605( 1 , 0 , 165 , 496 ) ChangeItem/13( [Object] ) MouseMove/-606( 1 , 0 , 162 , 488 ) ChangeItem/13( [Object] ) MouseMove/-606( 1 , 0 , 160 , 470 ) ChangeItem/13( [Object] ) MouseMove/-606( 1 , 0 , 157 , 434 ) ChangeItem/13( [Object] ) MouseUp/-607( 1 , 0 , 157 , 434 )
Syntax for Event event, /NET version, on:
private void Event(object sender,int EventID) { } Private Sub Event(ByVal sender As System.Object,ByVal EventID As Integer) Handles Event End Sub |
private void Event(object sender, AxEXRADIALMENULib._IRadialMenuEvents_EventEvent e) { } void OnEvent(long EventID) { } void __fastcall Event(TObject *Sender,long EventID) { } procedure Event(ASender: TObject; EventID : Integer); begin end; procedure Event(sender: System.Object; e: AxEXRADIALMENULib._IRadialMenuEvents_EventEvent); begin end; begin event Event(long EventID) end event Event Private Sub Event(ByVal sender As System.Object, ByVal e As AxEXRADIALMENULib._IRadialMenuEvents_EventEvent) Handles Event End Sub Private Sub Event(ByVal EventID As Long) End Sub Private Sub Event(ByVal EventID As Long) End Sub LPARAMETERS EventID PROCEDURE OnEvent(oRadialMenu,EventID) RETURN |
<SCRIPT EVENT="Event(EventID)" LANGUAGE="JScript"> </SCRIPT> <SCRIPT LANGUAGE="VBScript"> Function Event(EventID) End Function </SCRIPT> Procedure OnComEvent Integer llEventID Forward Send OnComEvent llEventID End_Procedure METHOD OCX_Event(EventID) CLASS MainDialog RETURN NIL void onEvent_Event(int _EventID) { } function Event as v (EventID as N) end function function nativeObject_Event(EventID) return |