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. Microsoft foundation class

Microsoft foundation class

Scheduled Pinned Locked Moved C / C++ / MFC
c++tutorial
5 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.
  • K Offline
    K Offline
    Kamlendra Chandra
    wrote on last edited by
    #1

    Hi, I am making a gui for an application, which requires me to invoke a windows command prompt inside a MFC gui window.I am very new to MFC, I will highly appreciate, if somebody can give an idea, how to invoke a windows command prompt inside a MFC window.

    J L 2 Replies Last reply
    0
    • K Kamlendra Chandra

      Hi, I am making a gui for an application, which requires me to invoke a windows command prompt inside a MFC gui window.I am very new to MFC, I will highly appreciate, if somebody can give an idea, how to invoke a windows command prompt inside a MFC window.

      J Offline
      J Offline
      Jochen Arndt
      wrote on last edited by
      #2

      Opening a command prompt window is not related to MFC. It can be performed by any Windows application using ShellExecute[^]:

      ShellExecute(NULL, _T("open"), _T("cmd.exe"), _T("/k"), NULL, SW_SHOW);

      ShellExecute starts cmd.exe here which opens the shell. The /k parameter specifies that the shell is not closed immediately but requires closing the window or typing 'exit' (type 'help cmd' in a shell to list available options). The fifth parameter can be used to specify a directory.

      K 1 Reply Last reply
      0
      • K Kamlendra Chandra

        Hi, I am making a gui for an application, which requires me to invoke a windows command prompt inside a MFC gui window.I am very new to MFC, I will highly appreciate, if somebody can give an idea, how to invoke a windows command prompt inside a MFC window.

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

        Why do you need a command prompt? Much better to use a label for the question, and an edit control (CEdit) for the response.

        1 Reply Last reply
        0
        • J Jochen Arndt

          Opening a command prompt window is not related to MFC. It can be performed by any Windows application using ShellExecute[^]:

          ShellExecute(NULL, _T("open"), _T("cmd.exe"), _T("/k"), NULL, SW_SHOW);

          ShellExecute starts cmd.exe here which opens the shell. The /k parameter specifies that the shell is not closed immediately but requires closing the window or typing 'exit' (type 'help cmd' in a shell to list available options). The fifth parameter can be used to specify a directory.

          K Offline
          K Offline
          Kamlendra Chandra
          wrote on last edited by
          #4

          Hi, I want to embedd the command prompt inside a mfc window, can u suggest some template and how to do this. Thanks, Kamlendra

          J 1 Reply Last reply
          0
          • K Kamlendra Chandra

            Hi, I want to embedd the command prompt inside a mfc window, can u suggest some template and how to do this. Thanks, Kamlendra

            J Offline
            J Offline
            Jochen Arndt
            wrote on last edited by
            #5

            Have a look at the article Redirecting an arbitrary Console's Input/Output[^].

            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