Context sensitive help in addins

Add-in Express™ Support Service
That's what is more important than anything else

Context sensitive help in addins
 
Thomas




Posts: 134
Joined: 2005-10-21
Hi,

I'm having some problem adding a context sensitive HTML help file (.chm).

If I use Delphi integrated methode (adding Vcl.HtmlHelpViewer in uses), the help opens but allways freeze on second call, and Outlook does not close correctly.

If I handle myself the context sensitive (Application.onHelp:=MyFunction), the help does not open when calling htmlHelp. This methode was working on previous versions of Delphi.

I wonder if somebody else had an experience with this.

Thanks.
Thomas.
Posted 22 Dec, 2016 06:10:01 Top
Andrei Smolin


Add-in Express team


Posts: 14123
Joined: 2006-05-11
Hello Thomas,

Could you please send us a project reproducing this issue to the support email address (see readme.txt)? Please make sure your email contains a link to this topic.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 22 Dec, 2016 07:57:07 Top
Thomas




Posts: 134
Joined: 2005-10-21
Hi Andrei,

Thank you for your reply. While preparing a project I got a bit further into this issue and discovered that the problem occurs only on modal forms, and it is a known issue (http://stackoverflow.com/questions/15012547/helpfile-opened-from-modal-window-unresponsive).

But the proposed solution (to call htmlhelp) does not work in an addin, the help simply does not open.

I have bypassed the issue by forcing the html help to close when a modal form closes:


procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  HtmlHelp(0, nil, HH_CLOSE_ALL, 0);
end;


It is not perfect, but at least it does not freeze...

I'll send you the sample project.
Thomas.
Posted 22 Dec, 2016 09:10:17 Top
Andrei Smolin


Add-in Express team


Posts: 14123
Joined: 2006-05-11
Hello Thomas,

Thomas writes:
Application.onHelp:=MyFunction


An add-in is a DLL loaded by another application. The Application object that you use, it isn't started/running when in a DLL. You need to use the HTMLHelp Windows API function to show the help. We've modified your project; I'll send it to you in a moment.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 23 Dec, 2016 03:44:23 Top
Thomas




Posts: 134
Joined: 2005-10-21
Thank you Andrei!

I've received the project, I'll test it asap.

Regards.
Thomas.
Posted 27 Dec, 2016 04:46:32 Top
Andrei Smolin


Add-in Express team


Posts: 14123
Joined: 2006-05-11
Hello Thomas,

You can also check https://msdn.microsoft.com/en-us/library/windows/desktop/ms670088(v=vs.85).aspx.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 27 Dec, 2016 07:53:49 Top
Thomas




Posts: 134
Joined: 2005-10-21
Thank you again Andrei, problem resolved. I think I need some holidays...
Thomas.
Posted 27 Dec, 2016 14:55:01 Top
Andrei Smolin


Add-in Express team


Posts: 14123
Joined: 2006-05-11
No problem ))

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 28 Dec, 2016 04:52:28 Top