ComOpen

This function must be called by an application before it can use a communications port. The call opens a communication port, pre-allocates and initializes the System Manager resources needed; clears the transmit and receive buffers; and, if successful, returns a "handle" to the application to use for all subsequent port activity.

There is the possibility that ComOpen could fail due to a lack of System Manager resources is one cause, so the application should be able to handle this condition.