Link to home
Start Free TrialLog in
Avatar of pmacbl
pmacbl

asked on

Delphi 7 Help display problem

When I assign a help file and help context to a menu item in my program, the correct help screen is not displayed when F1 is pressed.

It will display the first help item in the help file contents no matter which menu item you were on when you pressed F1.
Also, a small popup box is dispayed on the screen with the title of the correct help item topic name and it appears to be independent of the help screen and must be closed separately.

This only happens when I use a tmainmenu object. In my forms and other places, help works fine. Except there is a significant delay in the display of the help of about 3 to 4 seconds. It is long enough to were you wonder if you pressed the F1 key. This happens with all help calls anywhere in the application.

I have experimented in the Delphi IDE to see if I could get an idea of where the problem was. I found that when you bring up Delphi without any files open at all and press F1 on a pull-down menu. It will displays the help for the main menu item of that group. The pull-down menu is also closed when the help appears.

I have tried other applications (projects) and installed Delphi 7 on other computers, and I get the same results.

I would like to know:

1) how to make help work correctly in a tmainmenu object. Or if I cannot, what other menu object will work correctly.

2) how to make the screen screen come up immediately as it does in other Windows based programs.

Thanks
Avatar of Mainiacfreakus
Mainiacfreakus

Can I see your code please (to see how you are doing this).
I have an idea, but am unsure as to how you have implemented. (There is more than 1 way)

TIA

Mainiacfreakus
Avatar of pmacbl

ASKER

I am simply using the forms helpfile and helpcontext properties and the F1 key to call the help. There is no code involved on my end.
 
hi pmacbl

I am sorry, I cannot re-produce your described problems.
I have tried numerous ways, and only get it to show the correct help-context id.

Plz post ur form and unit code.

As for the delay with opening the helpfile, I can find no good solution at the moment.

Mainiacfreakus
Application.HelpFile :=Your Application Path+'\'+'YourHelpFile.hlp';
Application.HelpCommand(HELP_FINDER, 0);

Your help file extension depends on the help you use it can be chm also.
Hi

I can't seem to solve the problem of the help file loading slowly, but I seem to have solved your menu problem.

Application.HelpCommand(HELP_FINDER, 0); <-- This is the problem line....

The entire thing works if you take this out...
All my menus goto the correct place in the help file.

Description of problem:
Helpcommand is defined as follows

function HelpCommand(Command: Word; Data: Longint): Boolean;

Now, the Data is where the index your program is looking for in the help file goes, but you have assigned it to zero.
Delphi 7 automatically picks up the helpcontext from the menuitem, if you leave this line out.  Otherwise you may have to determine which item the mouse is over, pick up its helpcontext and pass it into this function.

Hope this fixes your problem...

Mainiacfreakus
Avatar of pmacbl

ASKER

No that did not resolve my problem.

I did find this information that tells me it is possibly a bug in Delphi 6 - 7.

http://www.helpware.net/delphi/index.html

Delphi 6 and above broke the OnHelp event which we rely on to override the Delphi WinHelp system (you will notice the some help events no longer fire). Please make sure you download "Delphi Example 12" which includes a fix file (D6OnHelpFix.pas). All you need to do is include the D6OnHelpFix.pas unit anywhere in your project and all help events will then fire as they did in Delphi 3/4/5.

I did not find anything that addresses the delay of the help displaying.

ASKER CERTIFIED SOLUTION
Avatar of GranMod
GranMod

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial