I have a question regarding the TextOut function. I have a window with an edit control. When text is entered in the edit control it displays the length of the text in the parent window. Here is the code...

Code:
case WM_COMMAND:
                 switch( HIWORD(wParam) ){
                       
                         //what to do if edit control is updated:
                         case EN_UPDATE:
                              int length;
                              std::stringstream s;
                              char StringOne[] = "Text Length:  ";

                              length = SendMessage( (HWND)lParam, WM_GETTEXTLENGTH, 0, 0 );
                              s << length;//convert int to string
                              strcat( StringOne, s.str().c_str() );//concat strings together
                              hdc = GetDC( hwnd );
                              DrawText( hdc, StringOne, strlen(StringOne), &rect, DT_LEFT);
                              ReleaseDC( hwnd, hdc );
                         break;
                 }
break;


It works fine until I hit backspace and go from single digit to double digit numbers. For example, if I have 9 characters in the edit control it says...

Text Length: 9

If I enter one more character, it says...

Text Length: 10

But if I hit backspace, it says...

Text Length: 90

When the string gets shorter it leaves that 0 remaining in the window. How do I set TextOut() so that when the output string gets shorter it erases the end of the last string?