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. URGEnt:How to open an application??

URGEnt:How to open an application??

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialc++question
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.
  • R Offline
    R Offline
    RaajaOfSelf
    wrote on last edited by
    #1

    Iam doing a MFC project for Asset Management . The requirement is that when a user selects a file ,the application corresponding to that application should open and display /play the file ... As an example ,if the file is c:\test.doc ,then MS word should be launched and should display the file .. ANother exmaple is if the file is c:\media.rm ,then the real player should be opened and should play the file .. How i do it in MFC ,or WIn 32 ???

    Z J J C 4 Replies Last reply
    0
    • R RaajaOfSelf

      Iam doing a MFC project for Asset Management . The requirement is that when a user selects a file ,the application corresponding to that application should open and display /play the file ... As an example ,if the file is c:\test.doc ,then MS word should be launched and should display the file .. ANother exmaple is if the file is c:\media.rm ,then the real player should be opened and should play the file .. How i do it in MFC ,or WIn 32 ???

      Z Offline
      Z Offline
      Zdeslav Vojkovic
      wrote on last edited by
      #2

      check the ShellExecute() API

      1 Reply Last reply
      0
      • R RaajaOfSelf

        Iam doing a MFC project for Asset Management . The requirement is that when a user selects a file ,the application corresponding to that application should open and display /play the file ... As an example ,if the file is c:\test.doc ,then MS word should be launched and should display the file .. ANother exmaple is if the file is c:\media.rm ,then the real player should be opened and should play the file .. How i do it in MFC ,or WIn 32 ???

        J Online
        J Online
        Joan M
        wrote on last edited by
        #3

        ShellExecute(...) take a look at this function... I think it's what you need... Hope this helps.

        https://www.robotecnik.com freelance robots, PLC and CNC programmer.

        1 Reply Last reply
        0
        • R RaajaOfSelf

          Iam doing a MFC project for Asset Management . The requirement is that when a user selects a file ,the application corresponding to that application should open and display /play the file ... As an example ,if the file is c:\test.doc ,then MS word should be launched and should display the file .. ANother exmaple is if the file is c:\media.rm ,then the real player should be opened and should play the file .. How i do it in MFC ,or WIn 32 ???

          J Offline
          J Offline
          Jump_Around
          wrote on last edited by
          #4

          Hi I hope you got a path to the file you want to be opened. CString path; Call ShellExecute(NULL, "open",path, NULL, NULL, SW_SHOW); Should work

          1 Reply Last reply
          0
          • R RaajaOfSelf

            Iam doing a MFC project for Asset Management . The requirement is that when a user selects a file ,the application corresponding to that application should open and display /play the file ... As an example ,if the file is c:\test.doc ,then MS word should be launched and should display the file .. ANother exmaple is if the file is c:\media.rm ,then the real player should be opened and should play the file .. How i do it in MFC ,or WIn 32 ???

            C Offline
            C Offline
            CodeBrain
            wrote on last edited by
            #5

            Try to use the ShellExecute API command. See the MSDN libraray for details. ShellExecute should do the job.

            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