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);

msg.data[0]=atoi((CStringA)m_edtD0);
msg.data[1]=atoi((CStringA)m_edtD1);
msg.data[2]=atoi((CStringA)m_edtD2);
msg.data[3]=atoi((CStringA)m_edtD3);
msg.data[4]=atoi((CStringA)m_edtD4);
msg.data[5]=atoi((CStringA)m_edtD5);
msg.data[6]=atoi((CStringA)m_edtD6);
msg.data[7]=atoi((CStringA)m_edtD7);