hi, after some search with google, i can't seem to find a proper tutorial on how to create help files in delphi applications.

I have no prior experience in creating help files in any client based applications, i was wondering if delphi ide itself has these components for me to write to?

Delphi provides you with the Microsoft Help Compiler (at least versions as old as D5 did), but using it directly is not fun.

You can google "help file creator" for the right stuff.

If you want to make HLP files, you can always check out Finn Christiansen's Shalom Help Maker, which is a nice, simple, 100% free tool. It looks like danish-shareware.dk is down right now... but you can google elsewhere.

If you want to make CHM files, I've never done that, so you'll have to sort through google yourself, alas.

Duoas, hi again.

I was wondering, is HLP files embeddable to delphi applications itself ?

Well, you can do that if you like, but you'd have to extract them before they could be used.

This is because WinHelp is a separate program which the application uses to display the help.

ok i had another go with this, i went through
http://www.devarticles.com/c/a/Delphi-Kylix/Building-a-Help-System-for-Delphi-Applications/

i downloaded my hcw from :
http://www.microsoft.com/Downloads/details.aspx?FamilyID=34d35502-4de9-4676-952c-34cc7f64f098&displaylang=en

but the application could not even call the help file at the end, when i click on 'help->about' it'll say that the file doesn't have table of contents!

what's weird, is that if i double click on the hlp file i compiled, and then click on contents, it ignores me and i won't see any table index.

if i move the file out from my project's folder and open the file, i could click on 'contents' and there'll be index coming out.

You are doing it the hard way. You really should download something like Shalom and use it...

The problem is that your help file doesn't have a table of contents. This is usually stored in a separate file, so you'd have frobinator.cnt frobinator.hlp How are you calling the help file? It doesn't need to have a contents, but WinHelp will complain if it is instructed to display the contents page for a help that doesn't have one.

(My own help files are often pretty small and succinct, so I tend to omit contents pages. However, all substantial help files should have a table of contents...)

In your code, you should have something like

procedure TForm1.FormCreate( Sender: tObject );
  begin
  // The help file is named the same as the program,
  // and is located in the same directory.
  application.helpFile := changeFileExt( paramStr( 0 ), '.hlp' )
  end;

procedure TForm1.AboutClick( Sender: tObject );
  begin
  // Context 42 is the help file's about page...
  application.helpContext( 42 )
  end;

If you use Shalom Help Maker, it can generate a little include file for you that gives constants for all the help contexts. So it could read:

...
implementation
{$R *.dfm}
{$include MY_HELP_Constants.inc}

...

procedure TForm1.AboutClick( Sender: tObject );
  begin
  application.helpContext( MY_HELP_ABOUT )
  end;

procedure TForm1.HelpClick( Sender: tObject );
  begin
  application.helpContext( MY_HELP_CONTENTS )
  end;

...

Hope this helps.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.