Virtual Serial Port Tools - Advanced serial port configurations for your custom ports usage scenario
Download Virtual Serial Port Tools Hide this button

IVirtualSerialLibraryListener Interface

This interface must be implemented by the library user if he wants to receive notification events. It is used only for native clients, while scripting clients may use the added, deleted and changed events.

The client must register its object with a library by calling the IVirtualSerialLibrary.addListener method and remove it by calling the IVirtualSerialLibrary.removeListener method. Failing to do so may result in circular references and in memory leaks.

This interface cannot be used by scripting clients.

Declaration

// This interface is not available in scripting environment
public interface IVirtualSerialLibraryListener
{

    // Methods
    void ${added}(Array devices);
    void ${deleted}(Array devices);
    void ${changed}(${IVirtualSerialDevice} device, ${ChangeMode} mode);
}
struct IVirtualSerialLibraryListener : IDispatch
{

    // Methods
    HRESULT ${added}(SAFEARRAY(${IVirtualSerialDevice}) devices);
    HRESULT ${deleted}(SAFEARRAY(${IVirtualSerialDevice}) devices);
    HRESULT ${changed}(${IVirtualSerialDevice} * device, ${ChangeMode} mode);
};

IVirtualSerialLibraryListener Methods

added

// This method is not available in scripting environment
void added(Array devices);
HRESULT added(SAFEARRAY(${IVirtualSerialDevice}) devices);
devices
List of new devices.

This method is invoked when new virtual serial device(s) appear on the system.

deleted

// This method is not available in scripting environment
void deleted(Array devices);
HRESULT deleted(SAFEARRAY(${IVirtualSerialDevice}) devices);
devices
List of deleted devices.

This method is invoked when virtual serial device(s) are deleted from the system.

changed

// This method is not available in scripting environment
void changed(${IVirtualSerialDevice} device, ${ChangeMode} mode);
HRESULT changed(${IVirtualSerialDevice} * device, ${ChangeMode} mode);
device
A reference to device whose state has changed.
mode
Identifies what has changed in a device.

This method is called when virtual serial device device state is changed to mode.