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. Calling an application using VC

Calling an application using VC

Scheduled Pinned Locked Moved C / C++ / MFC
questiontutorial
13 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.
  • T trinh nguyen

    Hi everyone, I have a simple question: How to call an application using VC? Thank you in advance.

    M Offline
    M Offline
    Mushtaque Nizamani
    wrote on last edited by
    #3

    There are many APIs for calling an application, the simplest one is WinExec(..), and other is CreateProcess which is more detialed. Regards, Mushq

    S S 2 Replies Last reply
    0
    • M Mushtaque Nizamani

      There are many APIs for calling an application, the simplest one is WinExec(..), and other is CreateProcess which is more detialed. Regards, Mushq

      S Offline
      S Offline
      Super Hornet
      wrote on last edited by
      #4

      Which API is better for calling another application

      M H 2 Replies Last reply
      0
      • S Super Hornet

        Which API is better for calling another application

        M Offline
        M Offline
        Mushtaque Nizamani
        wrote on last edited by
        #5

        CreateProcess(...) is more better, since you can apply wait on the process created by this API, and also can get the error after execution of your application, but it is slight slower than winexec(..).

        S 1 Reply Last reply
        0
        • S Super Hornet

          Which API is better for calling another application

          H Offline
          H Offline
          Hamid Taebi
          wrote on last edited by
          #6

          From the MSDN CreateProcess: This function is used to run a new program. It creates a new process and its primary thread. The new process executes the specified executable file. ---------------------- ShellExecute : Performs an operation on a specified file.


          WhiteSky


          T 1 Reply Last reply
          0
          • H Hamid Taebi

            From the MSDN CreateProcess: This function is used to run a new program. It creates a new process and its primary thread. The new process executes the specified executable file. ---------------------- ShellExecute : Performs an operation on a specified file.


            WhiteSky


            T Offline
            T Offline
            trinh nguyen
            wrote on last edited by
            #7

            Thank you for your replies. Very useful, I forgot how to call an application using VC and now I get it. Thank you. TRINH.NGUYEN

            H 1 Reply Last reply
            0
            • T trinh nguyen

              Thank you for your replies. Very useful, I forgot how to call an application using VC and now I get it. Thank you. TRINH.NGUYEN

              H Offline
              H Offline
              Hamid Taebi
              wrote on last edited by
              #8

              I glad you find it:)


              WhiteSky


              1 Reply Last reply
              0
              • M Mushtaque Nizamani

                There are many APIs for calling an application, the simplest one is WinExec(..), and other is CreateProcess which is more detialed. Regards, Mushq

                S Offline
                S Offline
                Sam Hobbs
                wrote on last edited by
                #9

                Win32-based applications should use the CreateProcess function. You should at least say something such as that and that it is important to read the documentation.

                M 1 Reply Last reply
                0
                • M Mushtaque Nizamani

                  CreateProcess(...) is more better, since you can apply wait on the process created by this API, and also can get the error after execution of your application, but it is slight slower than winexec(..).

                  S Offline
                  S Offline
                  Sam Hobbs
                  wrote on last edited by
                  #10

                  ShellExecuteEx also provides the ability to wait on the process.

                  1 Reply Last reply
                  0
                  • S Sam Hobbs

                    Win32-based applications should use the CreateProcess function. You should at least say something such as that and that it is important to read the documentation.

                    M Offline
                    M Offline
                    Mushtaque Nizamani
                    wrote on last edited by
                    #11

                    Sam Hobbs wrote:

                    You should at least say something such as that and that it is important to read the documentation.

                    but there are 100s of answers look like mine,then why are you telling me only.

                    S 1 Reply Last reply
                    0
                    • M Mushtaque Nizamani

                      Sam Hobbs wrote:

                      You should at least say something such as that and that it is important to read the documentation.

                      but there are 100s of answers look like mine,then why are you telling me only.

                      S Offline
                      S Offline
                      Sam Hobbs
                      wrote on last edited by
                      #12

                      I only saw yours.

                      1 Reply Last reply
                      0
                      • T trinh nguyen

                        Hi everyone, I have a simple question: How to call an application using VC? Thank you in advance.

                        H Offline
                        H Offline
                        Hamid Taebi
                        wrote on last edited by
                        #13

                        You can use also of Winexec or ShellExecute


                        WhiteSky


                        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