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. Opening File Through C++

Opening File Through C++

Scheduled Pinned Locked Moved C / C++ / MFC
c++algorithmshelpquestion
5 Posts 5 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
    MKlucher
    wrote on last edited by
    #1

    Does anyone know the command for executing a file through c++(MFC) (Opening the file with the assoicated program) I tried looking up execute or searching in the help but I'm not finding it.... Can anyone point me in the right direction?

    C D V G 4 Replies Last reply
    0
    • M MKlucher

      Does anyone know the command for executing a file through c++(MFC) (Opening the file with the assoicated program) I tried looking up execute or searching in the help but I'm not finding it.... Can anyone point me in the right direction?

      C Offline
      C Offline
      Chris Losinger
      wrote on last edited by
      #2

      see CreateProcess, WinExec and spawn. or see "system" if you want to launch from a shell. -c


      Image tools: ThumbNailer, Bobber, TIFFAssembler

      1 Reply Last reply
      0
      • M MKlucher

        Does anyone know the command for executing a file through c++(MFC) (Opening the file with the assoicated program) I tried looking up execute or searching in the help but I'm not finding it.... Can anyone point me in the right direction?

        D Offline
        D Offline
        Dave Bryant
        wrote on last edited by
        #3

        Take a look at ShellExecute(). Dave http://www.cloudsofheaven.org

        1 Reply Last reply
        0
        • M MKlucher

          Does anyone know the command for executing a file through c++(MFC) (Opening the file with the assoicated program) I tried looking up execute or searching in the help but I'm not finding it.... Can anyone point me in the right direction?

          V Offline
          V Offline
          vikramj
          wrote on last edited by
          #4

          you can call FindExecutable() which returns you the executable file's path associaated with the given file. then call shell execute on that :) rehards. Vikram

          1 Reply Last reply
          0
          • M MKlucher

            Does anyone know the command for executing a file through c++(MFC) (Opening the file with the assoicated program) I tried looking up execute or searching in the help but I'm not finding it.... Can anyone point me in the right direction?

            G Offline
            G Offline
            geo_m
            wrote on last edited by
            #5

            Try this one - for starting the executable associated with file and wait until the exec. is finished. SHELLEXECUTEINFO si; memset( &si, 0, sizeof(si) ); si.cbSize = sizeof( SHELLEXECUTEINFO ); si.fMask = SEE_MASK_NOCLOSEPROCESS; si.lpFile = szFileName; BOOL bRet = ShellExecuteEx( &si ); if( bRet && si.hProcess ) { // wait for process to end, process handle is stored in si.hProcess } hope this helps

            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