Короче, я малость прогнал, надо так:
AllocConsole(); freopen("CONOUT$", "wt", stdout); freopen("CONIN$", "rt", stdin);
Тема в архиве.