Solved

Problem with Application.HelpFile and ExtractFilePath(Application.ExeName)

Posted on 2002-04-19
3
315 Views
Last Modified: 2012-06-27
Hi experts,

In the *.dpr file of my application under construction there is this
line:

Application.HelpFile := 'C:\MyFiles\Programming\Projects\Sourcefiles\MyApp\MyApp.HLP';

I guess this code line has been created by the settings of my Delphi 6.0 Professional:

 Project/Options/Application/Helpfile

But actually I don't like this string constant. If I give my application to other users,
I can't be sure that they will install my application into the same directory as this is
the case on my PC.

And if my application is really installed to another directory, the code line above will
cause a run-time error, because the helpfile can't be found.

This is the reason why I try to code a more flexible solution.

I tried to accomplish my goal with this statement:

Application.HelpFile:= ExtractFilePath(Application.ExeName) + 'MyApp.HLP';

But as soon as I edit the *.dpr file, and make the described changes, I immediately get this error message:

Error in module myprogram: The Call of Application.CreateForm is missing or is not correct.

Do you know how I can solve this problem?  I think you will agree with me tzhat it is is really bad to assume that
the users of my program have the same directories on their computer. So I have to find a method to assign to path
to the help file dynamically. But obviously Delphi becomes rather angry, if anyone tries
to edit the project files.



0
Comment
Question by:mathes
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 27

Expert Comment

by:kretzschmar
ID: 6954431
do this
Application.HelpFile:= ExtractFilePath(Application.ExeName) + 'MyApp.HLP';

im the oncreate-event of your mainform

meikl ;-)
0
 
LVL 27

Accepted Solution

by:
kretzschmar earned 100 total points
ID: 6954443
or just left the path and write at
Project/Options/Application/Helpfile
only
MyApp.HLP

0
 

Author Comment

by:mathes
ID: 6956542
Dear Meikl,

thank you for your input. Your second idea works perfectly for me. I don't know if your other suggestion - changing
the OnCreate-event is applicaple. As far as I know a *.dpr file has no OnCreate-event.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses
Course of the Month10 days, 21 hours left to enroll

628 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question