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 call another project's exe file

How to call another project's exe file

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++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.
  • M Offline
    M Offline
    mr2003
    wrote on last edited by
    #1

    Hi,I have two MFC (MDI) projects written in VC++ 6.0, Project1, Project2 I would like to call the axcutable file of project2 in one of the menu options of project1. What is the code to do that? How can I have a pointer from project1 to the Doc and View class of project2 in order to access its functions???? Ehsan Behboudi

    D C 2 Replies Last reply
    0
    • M mr2003

      Hi,I have two MFC (MDI) projects written in VC++ 6.0, Project1, Project2 I would like to call the axcutable file of project2 in one of the menu options of project1. What is the code to do that? How can I have a pointer from project1 to the Doc and View class of project2 in order to access its functions???? Ehsan Behboudi

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

      mr2003 wrote: I would like to call the axcutable file of project2 in one of the menu options of project1. What is the code to do that? Use ShellExecute() or CreateProcess(). mr2003 wrote: How can I have a pointer from project1 to the Doc and View class of project2 in order to access its functions???? Either put the common code in a DLL that both EXEs can use, or have EXE1 post a message to EXE2.

      M 1 Reply Last reply
      0
      • M mr2003

        Hi,I have two MFC (MDI) projects written in VC++ 6.0, Project1, Project2 I would like to call the axcutable file of project2 in one of the menu options of project1. What is the code to do that? How can I have a pointer from project1 to the Doc and View class of project2 in order to access its functions???? Ehsan Behboudi

        C Offline
        C Offline
        Cambalindo
        wrote on last edited by
        #3

        I use this code to call one process from other char* program="project2.exe"; //llama al proceso EcoSG.exe y deja el proceso llamador en espera _spawnl(P_WAIT,program,program,arguments,NULL); Daniel Cespedes "There are 10 types of people, those who understand binary and those who do not" "Santa Cruz de la Sierra Paraiso Terrenal!" daniel.cespedes@ieee.org

        1 Reply Last reply
        0
        • D David Crow

          mr2003 wrote: I would like to call the axcutable file of project2 in one of the menu options of project1. What is the code to do that? Use ShellExecute() or CreateProcess(). mr2003 wrote: How can I have a pointer from project1 to the Doc and View class of project2 in order to access its functions???? Either put the common code in a DLL that both EXEs can use, or have EXE1 post a message to EXE2.

          M Offline
          M Offline
          mr2003
          wrote on last edited by
          #4

          thanks for the help... I have another question,, say in the menu of program1, i have to following function,, CPogram1View:: OnFile_CallProgram2_FunctionXXX() { //I want to be able to call that specific function of program2.. // how can I do that? } Ehsan Behboudi

          D 1 Reply Last reply
          0
          • M mr2003

            thanks for the help... I have another question,, say in the menu of program1, i have to following function,, CPogram1View:: OnFile_CallProgram2_FunctionXXX() { //I want to be able to call that specific function of program2.. // how can I do that? } Ehsan Behboudi

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

            Did you consult the documentation for the two functions I mentioned?

            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