1.用串口控件,并关联一个变量m_mscomm,用m_mscomm.put_PortOpen(true);打开串口,
2.之后用CString abc=L"sabcdjke";
m_mscomm.put_Output(COleVariant(abc));//发送数据
3.在接收数据时用:int   iCount   =   0;   
iCount   =m_mscomm.get_InBufferCount();   
VARIANT   vt;   
unsigned   char   *chData;  
chData= (unsigned char*)GlobalAlloc(GPTR,iCount+1);//该函数从堆中分配一定数目的字节数   
vt=m_mscomm.get_Input();   
memcpy(chData,(char*)(unsigned char*)vt.parray->pvData,iCount);
CString strtemp;
strtemp.Format(L"%s",chData);
MessageBox(strtemp);为什么打印出的内容为空???