couting output to a secondary console window

This is a discussion on couting output to a secondary console window within the C++ Programming forums, part of the General Programming Boards category; Well, I started a console window using AllocConsole(), but if I use std::cout<< nothing happens o.o How can I output ...

  1. #1
    Hail to the king, baby. Akkernight's Avatar
    Join Date
    Oct 2008
    Location
    Faroe Islands
    Posts
    717

    couting output to a secondary console window

    Well, I started a console window using AllocConsole(), but if I use std::cout<< nothing happens o.o
    How can I output stuff from the game window to this console window? Like, if I would press Space, I'd be able to output it onto the console screen?
    Last edited by Akkernight; 01-28-2009 at 06:29 AM.
    Currently research OpenGL

  2. #2
    Registered User Swarvy's Avatar
    Join Date
    Apr 2008
    Location
    United Kingdom
    Posts
    195
    You need to get a handle to the console window you've created before you can write to the console. Look up GetStdHandle() on msdn.

  3. #3
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  4. #4
    Registered User Swarvy's Avatar
    Join Date
    Apr 2008
    Location
    United Kingdom
    Posts
    195
    Quote Originally Posted by matsp View Post
    lol. I forgot I asked about this myself a while ago. lol.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem with creating new window, from another window
    By Garfield in forum Windows Programming
    Replies: 6
    Last Post: 01-11-2004, 02:10 PM
  2. Linux console window questions
    By GaPe in forum Linux Programming
    Replies: 1
    Last Post: 12-28-2002, 12:18 PM
  3. Picking up characters in console window
    By GaPe in forum C Programming
    Replies: 1
    Last Post: 11-03-2002, 06:21 PM
  4. Tab Controls - API
    By -KEN- in forum Windows Programming
    Replies: 7
    Last Post: 06-02-2002, 10:44 AM
  5. Recording console window output to a text file?
    By HolySmiter in forum C++ Programming
    Replies: 3
    Last Post: 02-24-2002, 03:13 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21