lotus



previous page: 11.2: Documentation Errors
  
page up: Programming VCOMM FAQ
  
next page: 11.4: Contention Management Errors

11.3: PortOpen Errors




Description

This article is from the Programming VCOMM FAQ, by nelson@desktop.nsc.com (Taed Nelson) with numerous contributions by others.

11.3: PortOpen Errors


[Fixed in version 2.02.] When it first returns NULL if it cannot find the port
(the message "Failed to acquire port"), it must update the pError variable
with IE_DEFAULT or some other type of error. pError should not be set in the
other error case since pPort->Open had been called, and that would have a
chance to set it to a better value.

[Fixed in version 2.02.] It does not check to see if the port is already open.
Look at the SERIAL.ASM example of how to do this. It should return IE_OPEN in
pError if this is detected.

The documentation for Open says that the port driver "may" choose to save hVM
in m_ownerVM, but there is no reason for the Open to do this since the class's
PortOpen already does it. It should probably be removed from the
documentation, since the port driver doesn't need to use it for anything else,
so why should it be responsible for updating it.

[Fixed in version 2.03.] [Contributed by Xianbin Wang (xwang@wco.com).] A
number of us saw problems with illegal port "stealing", such as Control Panel
| Modems | More Info... would take an open port from HyperTerminal. This is
probably due to PortOpen returning the port handle (instead of NULL) when a
port is actually open. Although, it does return an error value. Apparently,
More Info looks for a NULL handle instead of the error value.


 

Continue to:















TOP
previous page: 11.2: Documentation Errors
  
page up: Programming VCOMM FAQ
  
next page: 11.4: Contention Management Errors