When I open help file from my Windows Forms application I'm using this code.
public static void ShowHelp(string constant)
{
Help.ShowHelp(dummyFormForHelp.Value, CHMFile, HelpNavigator.Topic, constant);
}
It works fine except when I click on GO>URL... or Print button in the help file.
[
I get no messages and the app and chm file don't response at all. And I need go to task manager and kill the process. I have no idea what it is.
I tried to open the same file using the same code from the simple Windows Form application with only one form and everything was perfect. So I think something wrong in my application.
What can cause such issue? It's a big enterprise application with a lot of screens.
First of all question is not quite clear described:
dummyFormForHelp.Value
says nothing here, it is just lazy initialized instance of form to prevent topmost position of help window and allow to switch between application and helpdummyFormForHelp.Value
means:
private static readonly Lazy<Form> dummyFormForHelp = new Lazy<Form>(() =>
{
var form = new Form();
form.CreateControl();
return form;
});
Back to original issues with WinForms<>CHM Help:
Research shows that your issue with frozen application and opened chm is not unique:
Solution
Ways of resolving issue:
Start help as different process:
hh is added to windows path, so such commands can be executed easily:
hh "help.chm::/topic.html"
hh "help.chm::/topic.html#subtopic"
hh -mapid 12345 help.chm
Drawback of workaround: each call of help from application will open new instance of help.
EDIT: 28/08/2017
For future readers:
hh
was usedNow help works as expected.