Here is another way to "convert" an MFC SDI application into a console application.
Code for InitInstance -
if (m_lpCmdLine && *m_lpCmdLine)
{
puts("This is the console interface");
puts("The MFC main window has not been created");
puts("Hit a key to exit the program");
_getch();
return FALSE; // exit the program
}
else
{
ShowWindow(GetConsoleWindow(), SW_HIDE);
}
Code for ExitInstance to restore console if hidden -
int CMFCSDIconsoleApp::ExitInstance()
{
//TODO: handle additional resources you may have added
ShowWindow(GetConsoleWindow(), SW_SHOW);
....
After building the MFC SDI app use the VC++ EDITBIN utility to change the subsystem --