CodeGuru Forums -
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic Newsletters VB Forums Developer.com


Newest CodeGuru.com Articles:

  • Building Interactive UIs with ASP.NET Ajax: Rebinding Client-Side Events After a Partial Page Postback
  • Speed Up Repetitive Insert, Update, and Delete Query Statements
  • Binding Data to Silverlight 4.0 Controls Using ASP.NET MVC Framework 2.0
  • ADO.NET Data Services in the .NET Framework

  • Search CodeGuru:
     



    Go Back   CodeGuru Forums > Visual C++ & C++ Programming > Visual C++ Programming
    FAQ Members List Calendar Search Today's Posts Mark Forums Read

    Visual C++ Programming Ask questions about Windows programming with Visual C++ and help others by answering their questions.

    Reply
     
    Thread Tools Search this Thread Rate Thread Display Modes
      #1    
    Old September 3rd, 2009, 08:17 PM
    ahmd ahmd is offline
    Member +
     
    Join Date: Feb 2009
    Posts: 839
    ahmd will become famous soon enough (50+)
    [RESOLVED] Output text into console window from GUI app

    Say, if my GUI Win32 app is started from a Command Prompt, can I output text into that console window? FYI, at that point in time I haven't yet created a window, nor done any of the GUI app calls (RegisterClass, etc.)

    I'm pretty much asking for a command like this:
    Code:
    _tprintf(_T("Hello"));
    Reply With Quote
      #2    
    Old September 3rd, 2009, 10:28 PM
    Codeplug's Avatar
    Codeplug Codeplug is offline
    Senior Member
     
    Join Date: Nov 2003
    Posts: 1,346
    Codeplug is a glorious beacon of light (400+)Codeplug is a glorious beacon of light (400+)Codeplug is a glorious beacon of light (400+)Codeplug is a glorious beacon of light (400+)Codeplug is a glorious beacon of light (400+)Codeplug is a glorious beacon of light (400+)Codeplug is a glorious beacon of light (400+)
    Re: Output text into console window from GUI app

    You could try AttachConsole(ATTACH_PARENT_PROCESS).
    Then you just have to hook up stdout, stdin, and stderr.

    http://support.microsoft.com/kb/105305
    http://www.halcyon.com/~ast/dload/guicon.htm

    gg
    Reply With Quote
      #3    
    Old September 3rd, 2009, 11:47 PM
    ahmd ahmd is offline
    Member +
     
    Join Date: Feb 2009
    Posts: 839
    ahmd will become famous soon enough (50+)
    Re: Output text into console window from GUI app

    Thanks!
    Reply With Quote
    Reply

    Bookmarks
    Go Back   CodeGuru Forums > Visual C++ & C++ Programming > Visual C++ Programming


    Thread Tools Search this Thread
    Search this Thread:

    Advanced Search
    Display Modes Rate This Thread
    Rate This Thread:

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off
    Forum Jump


    All times are GMT -5. The time now is 02:18 AM.



    Acceptable Use Policy

    Internet.com
    The Network for Technology Professionals

    Search:

    About Internet.com

    Legal Notices, Licensing, Permissions, Privacy Policy.
    Advertise | Newsletters | E-mail Offers


    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.