SSC: Support COM ports greater than 9 (#707)

This commit is contained in:
tomcw 2019-10-24 21:43:00 +01:00
parent cb007df40b
commit d23d091caa
2 changed files with 3 additions and 3 deletions

View File

@ -252,7 +252,7 @@ bool CSuperSerialCard::CheckComm()
{
_ASSERT(m_dwSerialPortItem < m_vecSerialPortsItems.size()-1); // size()-1 is TCP item
TCHAR portname[SIZEOF_SERIALCHOICE_ITEM];
wsprintf(portname, TEXT("COM%u"), m_vecSerialPortsItems[m_dwSerialPortItem]);
wsprintf(portname, TEXT("\\\\.\\COM%u"), m_vecSerialPortsItems[m_dwSerialPortItem]);
m_hCommHandle = CreateFile(portname,
GENERIC_READ | GENERIC_WRITE,
@ -1258,7 +1258,7 @@ void CSuperSerialCard::ScanCOMPorts()
for (UINT i=1; i<32; i++) // Arbitrary upper limit
{
TCHAR portname[SIZEOF_SERIALCHOICE_ITEM];
wsprintf(portname, TEXT("COM%u"), i);
wsprintf(portname, TEXT("\\\\.\\COM%u"), i);
HANDLE hCommHandle = CreateFile(portname,
GENERIC_READ | GENERIC_WRITE,

View File

@ -83,7 +83,7 @@ private:
//
public:
static const UINT SIZEOF_SERIALCHOICE_ITEM = 8*sizeof(char);
static const UINT SIZEOF_SERIALCHOICE_ITEM = 12*sizeof(char);
private:
std::string m_ayCurrentSerialPortName;