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. Using Adobe Acrobat to open a .PDF

Using Adobe Acrobat to open a .PDF

Scheduled Pinned Locked Moved C / C++ / MFC
adobejsonhelptutorialquestion
3 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.
  • T Offline
    T Offline
    TheDelChop
    wrote on last edited by
    #1

    Hi, I am using the Windows API to write some code that uses the end user's already installed Adobe Acrobat Reader to open up a *.PDF file. My problem is locating the file. Everytime Adobe upgrades to another version of Adobe Acrobat the pathname changes, say for example from C:\Program Files\Adobe\Acrobat 5.0\Reader\Acrord32.exe to C:\Program Files\Adobe\Acrobat 7.0\Reader\Acrord32.exe which at the moment causes the routine to fail unless I have specified the correct directory. I am guessing there must be a much better way to do this, could anybody point me in the right direction? I would assume that you can ask the operating system what *.exe it uses to open up *.pdf and tell it to use that, but I am unsure how I code that. Could someone point me in the right direction? Thanks, Joe

    C T 2 Replies Last reply
    0
    • T TheDelChop

      Hi, I am using the Windows API to write some code that uses the end user's already installed Adobe Acrobat Reader to open up a *.PDF file. My problem is locating the file. Everytime Adobe upgrades to another version of Adobe Acrobat the pathname changes, say for example from C:\Program Files\Adobe\Acrobat 5.0\Reader\Acrord32.exe to C:\Program Files\Adobe\Acrobat 7.0\Reader\Acrord32.exe which at the moment causes the routine to fail unless I have specified the correct directory. I am guessing there must be a much better way to do this, could anybody point me in the right direction? I would assume that you can ask the operating system what *.exe it uses to open up *.pdf and tell it to use that, but I am unsure how I code that. Could someone point me in the right direction? Thanks, Joe

      C Offline
      C Offline
      CPallini
      wrote on last edited by
      #2

      You can call ShellExecute using as argument the path of the document to open (instead of that of the executable, see MSDN documentation for details...). hope that helps. :)

      If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.

      1 Reply Last reply
      0
      • T TheDelChop

        Hi, I am using the Windows API to write some code that uses the end user's already installed Adobe Acrobat Reader to open up a *.PDF file. My problem is locating the file. Everytime Adobe upgrades to another version of Adobe Acrobat the pathname changes, say for example from C:\Program Files\Adobe\Acrobat 5.0\Reader\Acrord32.exe to C:\Program Files\Adobe\Acrobat 7.0\Reader\Acrord32.exe which at the moment causes the routine to fail unless I have specified the correct directory. I am guessing there must be a much better way to do this, could anybody point me in the right direction? I would assume that you can ask the operating system what *.exe it uses to open up *.pdf and tell it to use that, but I am unsure how I code that. Could someone point me in the right direction? Thanks, Joe

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

        TheDelChop wrote:

        I am guessing there must be a much better way to do this, could anybody point me in the right direction? I would assume that you can ask the operating system what *.exe it uses to open up *.pdf and tell it to use that, but I am unsure how I code that.

        http://visualcpp.org/template_permalink.asp?id=125[^]

        "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

        cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief and you

        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