The following table lists the trappable errors for the MSComm control.
Constant | Value | Description |
comInvalidPropertyValue | 380 | Invalid property value |
comSetNotSupported | 383 | Property is read-only |
comGetNotSupported | 394 | Property is read-only |
comPortOpen | 8000 | Operation not valid while the port is opened |
8001 | Timeout value must be greater than zero | |
comPortInvalid | 8002 | Invalid Port Number |
8003 | Property available only at run time | |
8004 | Property is read only at runtime | |
comPortAlreadyOpen | 8005 | Port already open |
8006 | The device identifier is invalid or unsupported | |
8007 | The device's baud rate is unsupported | |
8008 | The specified byte size is invalid | |
8009 | The default parameters are in error | |
8010 | The hardware is not available (locked by another device) | |
8011 | The function cannot allocate the queues | |
comNoOpen | 8012 | The device is not open |
8013 | The device is already open | |
8014 | Could not enable comm notification | |
comSetCommStateFailed | 8015 | Could not set comm state |
8016 | Could not set comm event mask | |
comPortNotOpen | 8018 | Operation valid only when the port is open |
8019 | Device busy | |
comReadError | 8020 | Error reading comm device |
comDCBError | 8021 | Internal error retrieving device control block for the port |
2.Properties Description
CommPort
Settings
PortOpen
Input
Output
CommEvent
Syntax
object.CommEvent
The CommEvent property syntax has these parts:
Part Description
object An object expression that evaluates to an object in the Applies To list.
Remarks
Although the OnComm event is generated whenever a communication error or event occurs, the CommEvent property holds the numeric code for that error or event. To determine the actual error or event that caused the OnComm event, you must reference the CommEvent property.
The CommEvent property returns one of the following values for communication errors or events. These constants can also be found in the Object Library for this control.
Communication errors include the following settings:
Constant