|Download Help (Windows Only)|
Installs a handler for a nonstandard or new event type.
Assembly: NationalInstruments.VisaNS (in NationalInstruments.VisaNS.dll) Version: 22.214.171.124
|Visual Basic (Declaration)|
Public Sub InstallCustomEventHandler ( _ customEventType As Integer, _ handler As VisaEventHandler _ )
public void InstallCustomEventHandler( int customEventType, VisaEventHandler handler )
|VisaException||The NI-VISA driver returned an error as a result of calling this method.|
The customEventType is not recognized by the driver.
The handler delegate is invalid.
|DllNotFoundException||The NI-VISA driver library cannot be found.|
|EntryPointNotFoundException||A required operation in the NI-VISA driver library cannot be found.|
|ObjectDisposedException||This member is called after the Dispose method is called directly from code or indirectly through a finalizer.|
Use this method to receive nonstandard or new events that are not a part of this API. This method installs a handler for customEventType, and when the event occurs, the method that handler points to is executed. You can install more than one handler for the same custom event type. You can also install handlers for multiple custom event types.
|Note: In some cases, callbacks and event handlers are executed in a different thread than the rest of the program. Therefore, you must take special care when accessing objects that have thread affinity, such as UI controls, from these callbacks and event handlers. For more information, refer to Events, Callbacks, and Thread Safety in Measurement Studio .NET Class Libraries.|