Here are three areas that affect your applications ability to process incoming data.
1. The amount of time you spend in your Com callback. A callback cannot be called recursively. You won't be able to read new data at the com port until you return from the previous call to the Com callback. Do only essential tasks in your callback. If the other suggestions below don't help enough, consider creating a multi-threaded application and off-load most of the processing tasks to another thread.
2. The amount of time Windows spends on other applications. Look at the help for SetSleepPolicy. The default is VAL_SLEEP_MORE. Try using VAL_SLEEP_LESS or, as a last resort, VAL_SLEEP_NONE. Be careful sleeping LESS or NONE: this will affect the performance of all other Windows a
pplications.
3. The Input Queue Size, specified with OpenComConfig(). If you make the Queue Size larger, you'll have more time to process your data. The Queue is in hardware, so other Windows applications won't affect data going into the queue. Data is lost if the queue gets filled. A larger queue will take longer to fill. Your application can come back later without losing data. There is no maximum limit on the Input Queue Size.