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:
MouseIn/2( 0 ) MouseMove/-606( 0 , 0 , 184 , 420 ) MouseDown/-605( 1 , 0 , 184 , 420 ) DragStart/4( [Object] , =false ) MouseMove/-606( 1 , 0 , 185 , 420 ) Change/7( 0 ) Drag/5( [Object] ) DragEnd/6( [Object] , false ) MouseUp/-607( 1 , 0 , 337 , 382 ) MouseMove/-606( 0 , 0 , 338 , 383 ) MouseOut/3( 0 ) MouseMove/-606( 0 , 0 , 369 , 623 ) MouseMove/-606( 0 , 0 , 369 , 636 )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, AxEXGAUGELib._IGaugeEvents_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: AxEXGAUGELib._IGaugeEvents_EventEvent); begin end; begin event Event(long EventID) end event Event Private Sub Event(ByVal sender As System.Object, ByVal e As AxEXGAUGELib._IGaugeEvents_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(oGauge,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 |