tags:

views:

23

answers:

1

I am updating an old MFC application that used WinHelp so that it now uses HtmlHelp. I've changed the constructor of CWinApp-based class so that it calls EnableHtmlHelp(). Then I've changed the old calls from WinHelp( IDH_CONTENTS, HELP_CONTEXT) to HtmlHelp( IDH_CONTENTS, HH_HELP_CONTEXT). Unfortunately, whenever I try to open the help from my application, I see the help window appear and then it and my application immediately close. If I step through the code line-by-line, the help file appears and stays visible. Does anybody have any idea what's happening here and how I can fix it? Thanks.

A: 

Ok. I found it. I finally paid attention to this statement in the MSDN documentation:

When using the HTML Help API, set the stack size of the hosting executable to at least 100k. If the defined stack size is too small, then the thread created to run HTML Help will also be created with this stack size, and failure could result.

I changed my project settings to remove the Stack Reserve Size and now the help opens correctly.

Daedylus
Why don't you accept your own answer? Visitors of this page are happy to learn from your experience and if you click on the accept button, it will look better. At least in my opinion.
Lajos Arpad
StackOverflow won't let you accept your own answer until 2 days after you've posted it. As soon as I can, I'll accept this answer.
Daedylus