Email:
sales@wcscnet.com


Competent Technical Support By Knowledgeable Engineers

View Cart

Checkout

RSS Feed
Home
Products
Services
Support
File Download
Testimonials
NewsLetters
Press Releases
Tutorials
WebLog (News)
WCSC Partners
Developer Tools

Register for WCSC email updates

Wires No More!
$159.99 a pair


Wireless Serial Adapter
(Bluetooth to RS232)

 

Credit Card Merchant Services

If an application exits or crashes before a serial port opened with COMM-DRV/NT is closed, an error occurs when attempting to reopen the port.


The reason this occurs is that the port is still open. This is by design given the flexibility of COMM-DRV/NT. It allows several processes to have access to the opened port and as such we do not attach the port resource to any specific process. This should be taken into account when you design your application.

COMM-DRV/NT assigns port IDs sequentially. The first port opened will always be zero, the second 1, and so on.

If only one application is using COMM-DRV/NT, then if the application crashes, one needs to only pre-close the port open fails. A cleanup routine may look like the following.

 

#define    MYMAXPORT    5
void Cleanup()
{
for (VxDPId=0;VxDPId<MAX_PORTS;VxDPId++)
WCSCVxDCleanup(VxDPId);
}

If there may be more than one application running using COMM-DRV/NT, then the above routine would be dangerous, as it will close ports in use by other apps, likely causing a crash. This type of application might want to store the returned port ID in either the registry or file and pre-close said port ID if a subsequent open fails.

 

 

Last Updated: 04/03/2008

Copyright © 2008 by Willies Computer Software Co