Serial Framework C++ Edition

◆ ClaimPort()

int ClaimPort ( unsigned long &  Port)

Tries to get the lowest COM port number that is not already in use.

Parameters
PortIf the method completed with success on output contains the free COM port number.
Returns
If the function succeed the return value is WCL_E_SUCCESS. Otherwise the method returns one of the WCL error codes.

Please note that this method does not create any serial device. This just makes you sure that no one other application and/or driver creates serial (COM) device with the same number.