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. Supplying new command line parameters to the executable already active

Supplying new command line parameters to the executable already active

Scheduled Pinned Locked Moved C / C++ / MFC
question
6 Posts 6 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.
  • H Offline
    H Offline
    Hari Adarapu
    wrote on last edited by
    #1

    Hello, Is there a way to can send parameters through command line to the executable that is already active. Let me explain my requirement clearly. I have an exe which accepts command line parameters and one of the command line parameter is a file name. Now i need to input another file while the exe is still running. Please let me know if there a way to acheive this? Thanks, Hari krishna.

    CPalliniC D L T K 5 Replies Last reply
    0
    • H Hari Adarapu

      Hello, Is there a way to can send parameters through command line to the executable that is already active. Let me explain my requirement clearly. I have an exe which accepts command line parameters and one of the command line parameter is a file name. Now i need to input another file while the exe is still running. Please let me know if there a way to acheive this? Thanks, Hari krishna.

      CPalliniC Offline
      CPalliniC Offline
      CPallini
      wrote on last edited by
      #2

      You probably need some sort of IPC [^]. :)

      If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
      This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
      [My articles]

      In testa che avete, signor di Ceprano?

      1 Reply Last reply
      0
      • H Hari Adarapu

        Hello, Is there a way to can send parameters through command line to the executable that is already active. Let me explain my requirement clearly. I have an exe which accepts command line parameters and one of the command line parameter is a file name. Now i need to input another file while the exe is still running. Please let me know if there a way to acheive this? Thanks, Hari krishna.

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

        Not possible since the application is only started once, and thus main() is only called once.

        "Love people and use things, not love things and use people." - Unknown

        "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

        1 Reply Last reply
        0
        • H Hari Adarapu

          Hello, Is there a way to can send parameters through command line to the executable that is already active. Let me explain my requirement clearly. I have an exe which accepts command line parameters and one of the command line parameter is a file name. Now i need to input another file while the exe is still running. Please let me know if there a way to acheive this? Thanks, Hari krishna.

          L Offline
          L Offline
          led mike
          wrote on last edited by
          #4

          Adarapu Harikrishna wrote:

          Is there a way to can send parameters through command line to the executable that is already active.

          Yes. You could have the program prompt the user to supply the new file name.

          led mike

          1 Reply Last reply
          0
          • H Hari Adarapu

            Hello, Is there a way to can send parameters through command line to the executable that is already active. Let me explain my requirement clearly. I have an exe which accepts command line parameters and one of the command line parameter is a file name. Now i need to input another file while the exe is still running. Please let me know if there a way to acheive this? Thanks, Hari krishna.

            T Offline
            T Offline
            tibiz
            wrote on last edited by
            #5

            may be a solution: you run the app #1 in MSG processing define an own message, f.e. WM_OWNMSG run app #2 handle the command line parameters find/catch the main window of app #1 (f.e. throu FindWindow(...); ) send the cmdline parameters throu SendMessage(FindWindow(...), WM_OWNMSG, (LPARAM)cmdline, (WPARAM)whatWithIt);

            tibiZ.net homepage

            modified on Thursday, July 24, 2008 7:07 PM

            1 Reply Last reply
            0
            • H Hari Adarapu

              Hello, Is there a way to can send parameters through command line to the executable that is already active. Let me explain my requirement clearly. I have an exe which accepts command line parameters and one of the command line parameter is a file name. Now i need to input another file while the exe is still running. Please let me know if there a way to acheive this? Thanks, Hari krishna.

              K Offline
              K Offline
              KarstenK
              wrote on last edited by
              #6

              You got the communicate between your 2 apps. If the have Windows (HWND) you can post messages with approbiate values. Or make a network connection, write something in registry (file) were the other app have to read repeatedly.

              Greetings from Germany

              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