× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



One of the reasons I read this list is to keep on learning things :-). I didn't know abot ShellExecute -- I'll give it a try.


Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx> writes:
I don't understand this, Michael. Setting up so that Windows calls
Adobe Reader for PDF documents is automatically done when you install
Adobe Reader. Sure, it's possible for a user to undo that association,
but then they wouldn't be able to open PDFs from a browser, E-mail
client, Windows Explorer, et al. They'd have to manually open Adobe and
then use File/Open to read a PDF. Certainly possible, but who does
that in this day and age?

Or perhaps a better question, who does that *and* expects PDF documents
to just automatically open up for them on the screen?!

I do NOT, however, agree with Doug's suggestion of using the DOS "start"
command. The "start" command will lead to oodles of hard-to-solve
errors any time you have special characters in the path name. Plus, it
causes an ugly DOS window to open for each PDF.

Instead, use a Windows program with the ShellExecute() API, or
ShellExec_RunDLL from the command-line via the Rundll32 program.

And searching for and finding the adobe reader executable isn't a good
way to handle things, either. What if a user has more than one copy of
it, and is using one version for production use and another one just for
tests? How can your VB program know which one is which?

Or for whatever other reason, they have another program called AcroRd32?
How can you know which one to run? (It could even be a trojan taking
advantage of the way your VB program works to try to trick you into
running a malicious tool... unlikely perhaps, but possible.)

Perhaps only a small percentage of folks will do these things -- but
still -- why NOT do it the right way?


Mike Naughton
Senior Programmer/Analyst
Judd Wire, Inc.
124 Turnpike Road
Turners Falls, MA 01376
413-676-3144
Internal: x 444
mnaughton@xxxxxxxxxxxx
****************************************
NOTICE: This e-mail and any files transmitted with it are confidential and solely for the use of the intended recipient. If you are not the intended recipient or the person responsible for delivering to the intended recipient, be advised that any use is
strictly prohibited. If you have received this e-mail in error, please notify us immediately by replying to it and then delete it from your computer.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.