CByteArray类 操作的问题
刚学C++ 写了个串口通信程序(串口控件) 关联一个发送按钮,然后添加如下程序:
unsigned char send[52]={0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAB,0xF5,0x00,0x23,0x02,0x01,0x04,0x05,0x06,0x07,0x08,0x01,0xAB,0xAB,0xAB,0xAB,0xAB,0xAB,0xAB,0xAB,0xAB,0xAB,0xAB,0xAB,0xFF,0xFF,0xFF,0xFF,0x20,0x11,0x02,0x23,0x11,0x45,0x29,0x00,0xEF,0xB9,0xB9,0xB9,0xB9,0xB9,0xB9,0xB9,0xD7};
CString Output;
CByteArray train;
train.RemoveAll(); //数组清空
for(int i=0;i<52;i++)
{
train.Add(send[i]);
}
//Output.Format("%s test",send);
m_com.SetOutput(COleVariant(Output));求指点 :for循环结束 后面应该怎么操作才能把上面的数组元素转成字符串 赋给Output,为什么我用Output=train.Gstdata() 却只能得到 send【52】 前8个字节!!!串口发出来是 AA AA AA AA AA AA AA AB