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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. how to call exe file in vc++

how to call exe file in vc++

Scheduled Pinned Locked Moved C / C++ / MFC
c++tutorialquestion
9 Posts 7 Posters 4 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.
  • V Offline
    V Offline
    vc programmer 0
    wrote on last edited by
    #1

    how to call vc++ exe from another vc++ exe file can i call??

    P S T M 4 Replies Last reply
    0
    • V vc programmer 0

      how to call vc++ exe from another vc++ exe file can i call??

      P Offline
      P Offline
      parths
      wrote on last edited by
      #2

      ShellExecute[^] also the C 'system' function. try google to search for it

      "It was when I found out I could make mistakes that I knew I was on to something." -Ornette Coleman "Philosophy is a study that lets us be unhappy more intelligently." -Anon.

      P 1 Reply Last reply
      0
      • V vc programmer 0

        how to call vc++ exe from another vc++ exe file can i call??

        S Offline
        S Offline
        Sarfraz Anwar
        wrote on last edited by
        #3

        you can use ShellExecute to call any exe from ur application

        1 Reply Last reply
        0
        • V vc programmer 0

          how to call vc++ exe from another vc++ exe file can i call??

          T Offline
          T Offline
          ThatsAlok
          wrote on last edited by
          #4

          theer are numerous apis for achieving that like

          • ShellExecute/ShellExecuteEx

          • WinExec

          • CreateProcess

          U 1 Reply Last reply
          0
          • P parths

            ShellExecute[^] also the C 'system' function. try google to search for it

            "It was when I found out I could make mistakes that I knew I was on to something." -Ornette Coleman "Philosophy is a study that lets us be unhappy more intelligently." -Anon.

            P Offline
            P Offline
            pavanbhai
            wrote on last edited by
            #5

            To Call Exe File in VC ++ you have to use the Buildin Function "Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long" Hwnd as user Handle lpOperation as operation i.e. "open","print" lpFile as path of exe file thanks, Pavanbhai Pawar Software Programmer, Trans Tech Projects Pvt. Ltd. Pune 411 004. Mob: 9225527829 E-Mail Id:pawar@transtechprojects.com Personal ID : pavanbhai_pawar@yahoo.com

            1 Reply Last reply
            0
            • T ThatsAlok

              theer are numerous apis for achieving that like

              • ShellExecute/ShellExecuteEx

              • WinExec

              • CreateProcess

              U Offline
              U Offline
              User 451096
              wrote on last edited by
              #6

              HANDLE hProcess = NULL; SHELLEXECUTEINFO shellInfo; ::ZeroMemory(&shellInfo, sizeof(shellInfo)); shellInfo.cbSize = sizeof(shellInfo); shellInfo.fMask = SEE_MASK_FLAG_NO_UI | SEE_MASK_NOCLOSEPROCESS; shellInfo.lpFile = your app file; shellInfo.lpParameters = NULL; if(::ShellExecuteEx(&shellInfo)) { /* success */ hProcess = shellInfo.hProcess; if(hProcess != NULL){ ::WaitForSingleObject(hProcess, INFINITE); ::CloseHandle(hProcess); } }

              V 1 Reply Last reply
              0
              • U User 451096

                HANDLE hProcess = NULL; SHELLEXECUTEINFO shellInfo; ::ZeroMemory(&shellInfo, sizeof(shellInfo)); shellInfo.cbSize = sizeof(shellInfo); shellInfo.fMask = SEE_MASK_FLAG_NO_UI | SEE_MASK_NOCLOSEPROCESS; shellInfo.lpFile = your app file; shellInfo.lpParameters = NULL; if(::ShellExecuteEx(&shellInfo)) { /* success */ hProcess = shellInfo.hProcess; if(hProcess != NULL){ ::WaitForSingleObject(hProcess, INFINITE); ::CloseHandle(hProcess); } }

                V Offline
                V Offline
                vc programmer 0
                wrote on last edited by
                #7

                can i pass parameter exe to another exe.. pls tell me... again... thank u so much..

                U 1 Reply Last reply
                0
                • V vc programmer 0

                  can i pass parameter exe to another exe.. pls tell me... again... thank u so much..

                  U Offline
                  U Offline
                  User 451096
                  wrote on last edited by
                  #8

                  yes. ... ex: shellInfo.lpFile = _T("e_airyun.exe");

                  1 Reply Last reply
                  0
                  • V vc programmer 0

                    how to call vc++ exe from another vc++ exe file can i call??

                    M Offline
                    M Offline
                    Michael Dunn
                    wrote on last edited by
                    #9

                    See the FAQ 6.4 How do I run another program from my program?[^] --Mike-- LINKS~! Ericahist | 1ClickPicGrabber | CP SearchBar v2.0.2 | C++ Forum FAQ | You Are Dumb

                    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