Will set EmptyText to all spaces for the required length. As EmptyText is to use with TextOut you don't need a terminating NULL as you specify with TextOut the number of chars to display.
Code:
size_t tlen = p->Text.length();
char *EmptyText = new char[tlen];
memset(EmptyText, ' ', tlen);
However, this is not your problem. The problem you have is that you are writing onto a DC and therefore using the font selected into that DC. On the Console this DC font is NOT the font that the console uses to display console characters (change ' ' in your code to '@' and see what happens!). So if you persist in using gui functions for the console window then you have a whole lot of more work to do. Use the console supplied functions. They are far easier to use.