Thread: Output is command dos prompt not windows/frames

  1. #1
    Registered User
    Join Date
    Apr 2008
    Posts
    610

    Output is command dos prompt not windows/frames

    Being programming in Visual Studio 2005 now for two weeks and had no issues with output... Since yesterday, when i create new Win 32 Console Application projects, and try to run them. I get a command DOS output with "press any key to continue" text... Is this a setting i may have changed?

  2. #2
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    I get a command DOS output with "press any key to continue"
    And what do you expect?
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    – David J. Wheeler

  3. #3
    Registered User
    Join Date
    Apr 2008
    Posts
    610
    Ok, here's what' happening.. When i create a project, two .cpp files are added to the project, one is "stdafx.cpp" and other is "projectname.cpp" which contains these lines..

    Code:
    #include "stdafx.h"
    
    
    int _tmain(int argc, _TCHAR* argv[])
    {
    	return 0;
    }
    I suspected this is where DOS is run, but when i remove this file rebuild the project, no .exe file gets created... ???

    Code:
    	
    
    Linking...
    MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
    c:\Quest Projects\Visual Studio\Radar\RFSRange\Debug\RFSRange.exe : fatal error LNK1120: 1 unresolved externals
    Last edited by csonx_p; 04-25-2008 at 02:22 AM.

  4. #4
    Registered User
    Join Date
    Apr 2008
    Posts
    610
    Quote Originally Posted by vart View Post
    And what do you expect?
    A window which i've created using WinMain()

  5. #5
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    Quote Originally Posted by csonx_p View Post
    A window which i've created using WinMain()
    WinMain is for Windows application, not for Console application - so decide what you want to create
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    – David J. Wheeler

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. execl()/fork() output
    By tadams in forum C Programming
    Replies: 19
    Last Post: 02-04-2009, 03:29 PM
  2. Trying to store system(command) Output
    By punxworm in forum C++ Programming
    Replies: 5
    Last Post: 04-20-2005, 06:46 PM
  3. Output problems with structures
    By Gkitty in forum C Programming
    Replies: 1
    Last Post: 12-16-2002, 05:27 AM
  4. Output in DOS Prompt
    By siumui in forum C Programming
    Replies: 4
    Last Post: 12-06-2002, 11:27 PM
  5. sorting output on student info program
    By indigo0086 in forum C++ Programming
    Replies: 2
    Last Post: 11-05-2002, 11:29 AM