OnQueryOpen Event

This event fires when third-party serial application tries to open virtual serial port.


Visual Basic
Sub OnQueryOpen(pid As Long, Path As String)
Visual C++ (MFC)
void OnQueryOpen(LONG pid, LPCTSTR Path);



PID of the application trying to open the port.


Full path to the application trying to open the port.


The event fires only if QueryOpen property of the port is set to TRUE. The event handler should decide whether to allow opening a COM port or not to the serial application.
If it is needed to allow the application to open the port, AllowPortOpen method should be called withing the event handler.