943,749 Members | Top Members by Rank

Ad:
  • C Discussion Thread
  • Marked Solved
  • Views: 7381
  • C RSS
You are currently viewing page 2 of this multi-page discussion thread; Jump to the first page
Feb 12th, 2009
0

Re: Open PDF files at a certain page

Hi Prabakar,

What I've found out is GetDesktopWindow() works a bit different in Vista: it does not accept the directory info in the third parameter. So you have to indicate the directory in the fifth parameter. Kind of an ugly solution, as I will have to place the PDF files in the same directory where the reader exe is. Not good, but this is the only solution I could find for the moment.
Thanks very much for your help!!
Reputation Points: 10
Solved Threads: 0
Light Poster
marcosjp is offline Offline
42 posts
since Mar 2008
Feb 12th, 2009
0

Re: Open PDF files at a certain page

Same directory as the reader? Why not give the full address fo the file?

Like this,

  1. ShellExecute(NULL, "open", "\"D:\\program files\\Adobe Reader 9.exe\"",
  2. "/A page=45 \"C:\\Documents and Settings\\Prabakar\\My Documents\\Downloads\\How to Do Everything _ Ubuntu (McGraw-Hill).pdf\"", NULL, SW_SHOWNORMAL);
Reputation Points: 94
Solved Threads: 33
Posting Whiz
Prabakar is offline Offline
342 posts
since May 2008
Feb 14th, 2009
0

Re: Open PDF files at a certain page

Click to Expand / Collapse  Quote originally posted by Prabakar ...
Same directory as the reader? Why not give the full address fo the file?
Paths must never be hard coded. You must get them from Shell.
Reputation Points: -76
Solved Threads: 14
Junior Poster
marco93 is offline Offline
132 posts
since Apr 2008
Feb 14th, 2009
0

Re: Open PDF files at a certain page

Click to Expand / Collapse  Quote originally posted by marco93 ...
Paths must never be hard coded. You must get them from Shell.
That's what I always do, but, it looked like the OP was not satisfied with it.

What if he can't move it from a particular folder? ( happens often when it is a shared computer)

Copying the pdf and pasting it on a specific directory just to make your program work is not a good option

And adding the program to that directory might be irritating. It will be annoying to see a document in my songs folder.

Sometimes we need to use full address, or at least to use environment variables.
Last edited by Prabakar; Feb 14th, 2009 at 5:45 am.
Reputation Points: 94
Solved Threads: 33
Posting Whiz
Prabakar is offline Offline
342 posts
since May 2008

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C Forum Timeline: Dynamicaly defining a structure in C
Next Thread in C Forum Timeline: What method is better?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC