I have written a terminal interface program for windows. Everything works fine except when the program takes a character in from the serial port that is one of the special characters. ie. Backspace, Carriage Return, or anything that deletes old text. In these instances the richedit control does not perform the operation (it does not do the backspace) instead it spits out the character codes that make up the backspace. Does anyone know how to insert these special characters into the rich edit control???

Code I am using to instert into control:

Code:
void PrintIncomming(Passin SerialStream_in)
{
    int endin=1,write=0;
    char in=-1;
    string          SerialText("");
    LPSTR           SerialInitial = NULL;
    do{
        switch(ActivePort)
        {
            case 1:
                in=SerialPort_Access1.GetChar();
            break;
            case 2:
                in=SerialPort_Access2.GetChar();
            break;
            case 3:
                in=SerialPort_Access3.GetChar();
            break;
            case 4:
                in=SerialPort_Access4.GetChar();
            break;
        }
        if(in!=-1)
        {
            if(in==8)
            {
                write=0;
            }
            if(in==13)
            {
                write=0;
            }
            if(write==1)
            {
                SerialText=in;   
                SetStreamType(StreamType_Buffer);	//set stream as buffer
                SerialStream_in.streamedit.pfnCallback = EditStreamCallback;	//set callback
                SerialStream_in.streamedit.dwCookie = (unsigned long)&SerialText;	//pass address of buffer
                SendMessage(hTerm,EM_STREAMIN,SF_TEXT|SFF_SELECTION,(LPARAM)&SerialStream_in.streamedit);	//stream
            }
        }
        in=-1;
        write=1;
    }while(endin==1);  
}

thanks for any advice or input you can provide