Forum - Info Center - Eltima Software

Eltima Help Center => Virtual Serial Port Driver & Virtual Serial Port ActiveX => Topic started by: Narayanan on September 14, 2012, 11:58:32 AM

Title: Issue using virtual ports for sync communication
Post by: Narayanan on September 14, 2012, 11:58:32 AM
When I try to write a hyperterm connected to virtual port from my app, I cannot write unless I open the COMM device (createfile) using FILE_FLAG_OVERLAPPED. I am trying to perform synchronous I/O and I think FILE_FLAG_OVERLAPPED attribute is not needed.

e.g,
// open COMM device
FComHandle = CreateFile(szPort, GENERIC_READ | GENERIC_WRITE,
                     0,  // exclusive access
                     NULL, // no security attrs
                     OPEN_EXISTING,
      FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED,// overlapped I/O
                     NULL);

If I omit the FILE_FLAG_OVERLAPPED, I am unable to perform any writes.

Is this known issue? Please help.
Title: Re: Issue using virtual ports for sync communication
Post by: alexander-britt on September 19, 2012, 09:18:50 AM
I've replied to your via e-mail
To identify the problem we'll need to know the error code returned by GetLastError when the write operation fails.

Regards