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. How to write text to the command prompt in Dlg based Appln.

How to write text to the command prompt in Dlg based Appln.

Scheduled Pinned Locked Moved C / C++ / MFC
questioncsharpc++helptutorial
7 Posts 3 Posters 0 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.
  • Z Offline
    Z Offline
    zxc89
    wrote on last edited by
    #1

    I am using VC++ .NET(8 Version) to build a Dialog based application, however, my application allows user to input command arguments from the Command prompt window. I want to write some help message when user enters "Some.exe /?" at the command prompt. How can I write text to the command prompt window if user enters the above arguments?(Some.exe /?) Thanks in advance.

    N D Z 3 Replies Last reply
    0
    • Z zxc89

      I am using VC++ .NET(8 Version) to build a Dialog based application, however, my application allows user to input command arguments from the Command prompt window. I want to write some help message when user enters "Some.exe /?" at the command prompt. How can I write text to the command prompt window if user enters the above arguments?(Some.exe /?) Thanks in advance.

      N Offline
      N Offline
      Naveen
      wrote on last edited by
      #2

      when u start a dialog based application from the command line, the moment u press enter a new process is created. So the new process dont have any relation with the console. But in a console based application, both the console and the new application exists in same process. Better u output the help string in a messagebox( check the regsvr32.exe application. It shows the help in message box:-D )

      nave

      Z 1 Reply Last reply
      0
      • N Naveen

        when u start a dialog based application from the command line, the moment u press enter a new process is created. So the new process dont have any relation with the console. But in a console based application, both the console and the new application exists in same process. Better u output the help string in a messagebox( check the regsvr32.exe application. It shows the help in message box:-D )

        nave

        Z Offline
        Z Offline
        zxc89
        wrote on last edited by
        #3

        Thanks for the Reply. Is there any way to get the HANDLE of the console where we are executing our Dlg Based Appln. I have read about AllocConsole() and GetStdHandle() but could not corelate with my problem. Plz Help

        N 1 Reply Last reply
        0
        • Z zxc89

          Thanks for the Reply. Is there any way to get the HANDLE of the console where we are executing our Dlg Based Appln. I have read about AllocConsole() and GetStdHandle() but could not corelate with my problem. Plz Help

          N Offline
          N Offline
          Naveen
          wrote on last edited by
          #4

          zxc89 wrote:

          Is there any way to get the HANDLE of the console

          sorry i dont know. Even if there is a way what u gone do if i immediately close the console after pressing enter? :^)

          nave

          1 Reply Last reply
          0
          • Z zxc89

            I am using VC++ .NET(8 Version) to build a Dialog based application, however, my application allows user to input command arguments from the Command prompt window. I want to write some help message when user enters "Some.exe /?" at the command prompt. How can I write text to the command prompt window if user enters the above arguments?(Some.exe /?) Thanks in advance.

            D Offline
            D Offline
            David Crow
            wrote on last edited by
            #5

            If I understand you correctly, these two articles may be of some help: http://support.microsoft.com/default.aspx?scid=kb;en-us;190351[^] http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/creating_a_child_process_with_redirected_input_and_output.asp[^]


            "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

            "Judge not by the eye but by the heart." - Native American Proverb

            N 1 Reply Last reply
            0
            • D David Crow

              If I understand you correctly, these two articles may be of some help: http://support.microsoft.com/default.aspx?scid=kb;en-us;190351[^] http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/creating_a_child_process_with_redirected_input_and_output.asp[^]


              "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

              "Judge not by the eye but by the heart." - Native American Proverb

              N Offline
              N Offline
              Naveen
              wrote on last edited by
              #6

              hi DavidCrow, In both of the link u give the parent application have to redirect the child applications stdout. This is not possible in his case since the parent applicaton is command prompt. He is searching for a way to redirect the output from the child process itself.

              nave

              1 Reply Last reply
              0
              • Z zxc89

                I am using VC++ .NET(8 Version) to build a Dialog based application, however, my application allows user to input command arguments from the Command prompt window. I want to write some help message when user enters "Some.exe /?" at the command prompt. How can I write text to the command prompt window if user enters the above arguments?(Some.exe /?) Thanks in advance.

                Z Offline
                Z Offline
                zxc89
                wrote on last edited by
                #7

                Can anyone Help.I had tried different ways but i coulnot succeed.

                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