Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I show a PDF file from within my app?

Status
Not open for further replies.

tedsmith

Programmer
Nov 23, 2000
1,762
AU
I have a PDF file that contains the instruction manual for the application.
How can I start it from a 'Help" button on my app?

If I use Shell"Acrobat MyApplication" ,how do I find the path name of the Acrobat reader as it can be different versions and locations in different computers?
 
You can use the shellexecute API with the "print" verb/keyword or if you have adobe installed, you may be able to use the PDF Viewer control and the LoadFile method...



Good Luck

 
I don't understand your first solution, could you please explain?

I didn't want to use the PDF viewer method because it is not installed with my app and I didn't want to reinstall my app - just issue a revised EXE file only and use the current installed Adobe viewer.


 
Ted, I use the ShellExecute API to do the same thing;

Code:
ShellExecute vbNull, "Open", <PDFFILE>, 0&, 0&, 1&

Patrick
 
Add-Ins>Add-In Manager>Api Viewer>Loaded>OK>

ALT>F>Load Text File>Win32API.txt

ShellExecute and yeah, PatrickIRL has the right verb, "open
 
Amazing vb5prgrmr! Even though I've been using vb6 since they invented it, I never knew you could get the declaration so easily! I always had to work it out from C or find someone else's example.
 
>I never knew you could get the declaration so easily

<boggle>

You mean all this time that we've been passing you bits of API code ... crikey ...
 
(mind you the API file as shipped with VB6 is quite old, so it misses a lot of new stuff - and also has a few errors in it)
 
Now hopefully this shows up here...

Here is one of the "updated" API viewers out there...


and someplace around here (on the web) I could have sworn there was a new win32api.zip that contained a vb project and api text file that contained api's up to xp or vista... But cannot find it now???



Good Luck
 
Yes, but I suppose none of you actually wrote the 'bits of code' that are in the declarations unless you worked for Microsoft so it is the same code as the API viewer.

I knew of the existence of the API viewer but though it was only for "viewing APIs" and getting constant's values, not providing their declarations you can simply cut and paste.

I wonder if many others fell for the same trap? It might explain the avoidance of APIs by many?
 
> but I suppose none of you actually wrote

Actually, there are plenty of times when I've written the necessary VB declaration rather than using the viewer. Either becasue the viewer was wrong, or becasue it was missing entries, or becasue I needed the API call to work slightly differently (variants of SendMessage, for example)

Obviously to do that we need a template for the API call from somewhere, and I normally get that from the Windows SDK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top