Home arrow Delphi-Kylix arrow Page 4 - Building a Help System for Delphi Applications
DELPHI-KYLIX

Building a Help System for Delphi Applications


Complicated applications need help systems so that those who use them have somewhere to turn when they get stuck. Fortunately, they needn't be difficult to build. This article explains how to create a help system for a Delphi application.

Author Info:
By: Leidago
Rating: 4 stars4 stars4 stars4 stars4 stars / 6
January 02, 2007
TABLE OF CONTENTS:
  1. · Building a Help System for Delphi Applications
  2. · Creating Contents, Headings and Topics
  3. · Creating the Help Text
  4. · Creating the MAP File

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
Building a Help System for Delphi Applications - Creating the MAP File
(Page 4 of 4 )

The last file that we need to create is the MAP file. This file basically contains numerical references to your topic and will be used by Delphi to show the right topics when the user selects a topic. So open up notepad or any simple text editor and add the following:

#define IDH_HOWTOCREATEHELPFILE1 100

#define IDH_BEGINNING1 200

#define IDH_HOWTOCREATEHELPFILE2  300

#define IDH_HOWTO2  400

Save the file as MyProject.MAP. It is very important that the .map extension is there, so make sure that it is. Next, we need to add the file to our project, so open up your help project (.hpj file) and click on the "map" button. A new window should pop up with four buttons on the side. Click on "add" and navigate to where you saved your map file. Select it and press OK. You should now be returned to the main window.

Next we need to define the type of window in which your help program is going to appear. Here we define the width, height and name of the window. So click on the "windows" button and click on "Add." Enter "MAIN" as the type of window and where it says "based on this Standard Window" leave it as "Procedure." Click OK and you should now be back to the "Windows Properties" dialog box. Enter the following text where it says "title bar text:"

Project Help File

and then select the "Keep Help Window on top" option. Your "Windows Properties Dialog Box" should look something like this:

Click OK and you should now be returned to the main window, which should look something like this:

Now all that is left is compiling the project. So click on "save and compile" and you should now have a help file in the folder in which you saved your original help project.

Linking Help File to Application

To link your newly created help file to your application, simply copy the .hlp file (your help file) to the same directory as your exe. And then on the OnformCreate event handler of your application add the following code (assuming that your help file is called "myhelpfile.hlp"):

Application.helpfile:='myhelpfile.hlp';

To launch the help file from within your menu item or  from a button, add the following code:

application.helpcommand(HELP_CONTENTS,0);

That's it! You will now have a fully functioning help system for your project.


DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

blog comments powered by Disqus
DELPHI-KYLIX ARTICLES

- Loading an XML Document into the DOM
- Delphi Wrapper Classes and XML
- Delphi and the DOM
- Delphi and XML
- Internet Access: Client Service
- Finishing the Client for an Internet Access ...
- The Client for an Internet Access Control Ap...
- User Management for an Internet Access Contr...
- Important Procedures for an Internet Access ...
- Server Code for an Internet Access Control A...
- Constructing the Interface for an Internet A...
- Building a Server Application for an Interne...
- Building an Internet Access Control Applicat...
- Client Dataset: Working with Data Packets an...
- Using the Client Dataset in an N-Tiered Appl...

Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 



© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 6 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials