IEventManager::EnableEvent
Description
Enables notification of an event identified by the eventType parameter for mechanisms specified in the mechanism parameter. The specified session can be enabled to queue events by specifying EVENT_QUEUE.
Applications can enable the session to invoke a callback function to execute the handler by specifying EVENT_HNDLR. The applications are required to install at least one handler to be enabled for this mode. Specifying EVENT_SUSPEND_HNDLR enables the session to receive callbacks, but the invocation of the handler is deferred to a later time. Successive calls to this function replace the old callback mechanism with the new callback mechanism. Specifying ALL_ENABLED_EVENTS for the eventType parameter refers to all events which have previously been enabled on this session, making it easier to switch between the two callback mechanisms for multiple events.
Any combination of VISA-defined values for different parameters of this function is also supported (except for EVENT_HNDLR and EVENT_SUSPEND_HNDLR, which apply to different modes of the same mechanism).
VB Prototype
EnableEvent(
type As EventType,
mech As EventMechanism,
customEventType As Long ' Optional Parameter
)
C++ Prototype
HRESULT EnableEvent(
EventType type,
EventMechanism mech,
long customEventType
);
Parameters
type
The type of event to enable.
mech
The mechanism type for the event to enable.
customEventType
[Optional in Visual Basic] If the event type property is CUSTOM_EVENT_TYPE, this argument contains the custom event type number, otherwise it is ignored.
Return Value
Refer to the table of return codes.
See Also
ComponentVersion, SpecVersion, HardwareInterfaceName, HardwareInterfaceNumber, HardwareInterfaceType, LockState, OptionString, ProgID, ResourceName, SessionType, SoftwareManufacturerID, SoftwareManufacturerName, Timeout, LastStatus, MaximumQueueLength, GetAttribute, SetAttribute, LockRsrc, UnlockRsrc, Init, Close, EnableEvent, DisableEvent, DiscardEvents, WaitOnEvent, InstallHandler, UninstallHandler, IEventManager Overview