Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Writing to same console in MFC

Writing to same console in MFC

Scheduled Pinned Locked Moved C / C++ / MFC
csharpc++visual-studiosysadminhelp
3 Posts 3 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sma123
    wrote on last edited by
    #1

    Hi, I have a MFC application. When I run the .EXE from a command prompt, and if I want help (eg. xcopy /?), can I get control of the command prompt window to print the message over there? I tried using AllocConsole(), but that opens a new console. I want to do it on the same command line. I am aware of AttachConsole() which needs SDK and will work for OS XP onwards. Unfortunately mine is WIN 2000 server and Visual studio 6. Can anyone help me in this regard. Thanks SAM

    L A 2 Replies Last reply
    0
    • S sma123

      Hi, I have a MFC application. When I run the .EXE from a command prompt, and if I want help (eg. xcopy /?), can I get control of the command prompt window to print the message over there? I tried using AllocConsole(), but that opens a new console. I want to do it on the same command line. I am aware of AttachConsole() which needs SDK and will work for OS XP onwards. Unfortunately mine is WIN 2000 server and Visual studio 6. Can anyone help me in this regard. Thanks SAM

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      If you are running it from a command prompt then all output should automatically go to that window. Perhaps you could clarify your problem.

      1 Reply Last reply
      0
      • S sma123

        Hi, I have a MFC application. When I run the .EXE from a command prompt, and if I want help (eg. xcopy /?), can I get control of the command prompt window to print the message over there? I tried using AllocConsole(), but that opens a new console. I want to do it on the same command line. I am aware of AttachConsole() which needs SDK and will work for OS XP onwards. Unfortunately mine is WIN 2000 server and Visual studio 6. Can anyone help me in this regard. Thanks SAM

        A Offline
        A Offline
        Albert Holguin
        wrote on last edited by
        #3

        When you run an exe from the command prompt, the command prompt IS your default standard output. Your question doesn't exactly make sense.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups