Leonardo CDC can not send.

Hi,
I am using a Leonardo. My software (in C#) communicate with Leonardo by the CDC.

USE C# can send down, can not receive, LED Rx flash but TX not.

When the software sends data, the Rx LED on Leonardo is flashing, and the Motor works as my data.(motors controlled by Leonardo), but I can not receive any data form Leonardo.

USE UartAssist.exe can send down, can receive, LED Rx TX is flashed.
USE Serial Port Utility.exe can send down, can not receive, LED Rx flash but TX not.

I think that app has open serial by difference way, when opened, CDC driver send message to Leonardo by USB, and Leonardo open the CDC, so that Arduino call Serial.write(a); data will be send when port opened.

Some apps open serial, but not send a message to Leonardo. Serial.write(a); may not worked.

What should I do? The following is C# open port

        ///
        public int Open()
        {
            if (Opened)
            {
                this.Close();
            }
            DCB dcb = new DCB();
            COMMTIMEOUTS ctoCommPort = new COMMTIMEOUTS();

            // 打开串口
            hComm = CreateFile("\\\\.\\" + Port, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0);
            if (hComm == INVALID_HANDLE_VALUE)
            {
                throw(new Exception( "打开文件错误,编号为"+GetLastError().ToString()));
            }

            // 设置通信超时时间
            GetCommTimeouts(hComm, ref ctoCommPort);
            ctoCommPort.ReadIntervalTimeout = -1;
            ctoCommPort.ReadTotalTimeoutConstant = 0;
            ctoCommPort.ReadTotalTimeoutMultiplier = 0;
            ctoCommPort.WriteTotalTimeoutMultiplier = 0;
            ctoCommPort.WriteTotalTimeoutConstant = 0;
            SetCommTimeouts(hComm, ref ctoCommPort);

            //设置串口参数
            GetCommState(hComm, ref dcb);
            dcb.DCBlength = Marshal.SizeOf(dcb);
            dcb.BaudRate = BaudRate;
            dcb.flags = 0;
            dcb.ByteSize = (byte)ByteSize;
            dcb.StopBits = StopBits;
            dcb.Parity = (byte)Parity;

            //------------------------------
            SetDcbFlag(0, 1, dcb);            //二进制方式
            SetDcbFlag(1, (Parity == 0) ? 0 : 1, dcb);
            SetDcbFlag(2, 0, dcb);            //不用CTS检测发送流控制
            SetDcbFlag(3, 0, dcb);            //不用DSR检测发送流控制
            SetDcbFlag(4, 0, dcb);            //禁止DTR流量控制
            SetDcbFlag(6, 0, dcb);            //对DTR信号线不敏感
            SetDcbFlag(9, 1, dcb);            //检测接收缓冲区
            SetDcbFlag(8, 0, dcb);            //不做发送字符控制
            SetDcbFlag(10, 0, dcb);           //是否用指定字符替换校验错的字符
            SetDcbFlag(11, 0, dcb);           //保留NULL字符
            SetDcbFlag(12, 0, dcb);           //允许RTS流量控制
            SetDcbFlag(14, 0, dcb);           //发送错误后,继续进行下面的读写操作
            //--------------------------------
            dcb.wReserved = 0;                       //没有使用,必须为0      
            dcb.XonLim = 0;                          //指定在XOFF字符发送之前接收到缓冲区中可允许的最小字节数
            dcb.XoffLim = 0;                         //指定在XOFF字符发送之前缓冲区中可允许的最小可用字节数
            dcb.XonChar = 0;                         //发送和接收的XON字符
            dcb.XoffChar = 0;                        //发送和接收的XOFF字符
            dcb.ErrorChar = 0;                       //代替接收到奇偶校验错误的字符
            dcb.EofChar = 0;                         //用来表示数据的结束     
            dcb.EvtChar = 0;                         //事件字符,接收到此字符时,会产生一个事件       
            dcb.wReserved1 = 0;                      //没有使用

            if (!SetCommState(hComm, ref dcb))
            {
                Opened = false;
                return -2;
            }
            Opened = true;
            return 0;
        }

You should ask that question in a Windows forum. It's not Arduino related (it could be any serial COM port, it doesn't make a difference if there is a Leonardo or a modem).