HtmlHelp() closes my MFC application
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开发者_JAVA百科 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.
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.
精彩评论