RTR Send Issue on CAN BUS

I am developer of fieldbus such as CANOpen, Modbus.
These day I tested your solution for implementation in our device.
but I found out some problem.
Please review this and advice me.

  1. Receiving RTR was OK , but Can’t sent RTR.
    The CanMsg always sent format of DATA.

  2. When I sent the CanMsg has data length is zero.
    First time, the CanMsg was sent without error, next time the CanMsg was sent with error. ( return FALSE)

  3. When I received CanMsg without RTR, the CanMsg was updated according data length correctly.
    But I received CanMsg with RTR, the CanMsg didn’t update according length.

Dear valter.tx

Could you check the question 1?

I attached test project file to help your support.

test project

please review this file and let me know what is problem.

I use under code to send RTR .

The bus speed is 250KHz.

    msg.id = atoi((CStringA)m_edtID);
msg.dataLen = atoi((CStringA)m_edtDLC);
msg.canMsgFlags = (m_chkRTR ? CanMsgFlags_RTR : 0);