RegisterComEvent - DfComAutomationObject
Registers a COM event in the runtime COM event handler routine.
Type: Procedure
Parameters
| Parameter | Type | Description |
|---|---|---|
| Arg1 | Integer | Method ID (eg 1, -600 etc) |
| Arg2 | Integer | DataFlex method ID (e.g. msg_OnComClick). When the virtual machine receives this event the DataFlex method OnComClick will be executed. |
Syntax
Procedure RegisterComEvent Integer Arg1 Integer Arg2
Call Example
Send RegisterComEvent Arg1 Arg2
Description
This method registers a COM event in the runtime COM event handler routine. Only events that exist in the COM component can be registered. You cannot extend the events with events of your own.
You will find the usage of this RegisterComEvent method inside the method RegisterComEvents of the events class wrapper. For example (from StdFont.Pkg):
// Event interface for the Font object
Class cComFontEvents is a Mixin
//Doc/ Type=Event Interface=Public
Procedure OnComFontChanged String llPropertyName
End_Procedure
//Doc/ Interface=Private NoDoc=True
Procedure RegisterComEvents
Send RegisterComEvent 9 msg_OnComFontChanged
End_Procedure
End_Class // cComFontEvents
If an event has parameters, these are automatially passed to the registered method. You cannot specify them with the RegisterComEvent procedure.