Set unsigned character value to CString type edit control in mfc

In my MFC dialogue based application, I want to Read data through serial port and whatever data received from that,displayed into Edit control,but somehow it is not working,as I used below methodology:
1
2
3
4
5
6
7
8
9
10
CString msg;
    msg.Format(L"%c",Buff);*/
    //strcpy( (char*)Buff,ThreadStruct->m_handleDlg->m_console);//"Hello World");
    while(1)
    {
        ReadFile(DeviceHandle,&Buff,1,&WriteBytes,NULL);
        //ThreadStruct->m_handleDlg->m_OutConsole.ReplaceSel(L"\r\n\r\n\r"+msg+L"\r\n\r\n\r");
        //ThreadStruct->m_handleDlg->m_OutConsole.SetWindowTextW(Buff);
        //ThreadStruct->m_handleDlg->m_console.Format(L"%uc",Buff);
    }

for above code I used worker thread.So that used ThreadStruct.
above no one is running,gives error! How to do that?
Topic archived. No new replies allowed.