Jonathan Wood
2010-05-07 03:15:09 UTC
I created a brand new MFC dialog-based application using Visual Studio 2010.
I chose the option to create context-sensitive help. I can manually open the
CHM file and it looks fine. But when I either hit F1 or click the Help
button (ID_HELP) in my dialog box, I get a message box that says "Failed to
launch help."
After considerable time, I've managed to isolate the routine that is
failing. AfxHtmlHelp() loads hhctrl.ocx and gets the function address for
"HtmlHelpW". Both of these steps are successful. But when it calls
HtmlHelp() via the pointer, 0 is returned. And when that value of 0 is
returned back to CWnd::HtmlHelp(), the "Failed to launch help" message is
displayed.
One thing I didn't quite understand is that the hWnd argument sent to
AfxHtmlHelp() shows in the debugger as "hWnd = 0x00430638 {unused=0 }". As
you can see, it's not NULL but I don't know if the "unused" comment is just
because it's not accessible or what.
Does anyone have any ideas on this? I don't know a whole lot about HTML help
but this is the main dialog box created by the Wizards so I kind of figure
this would work right out of the box. I'm not sure where else to look.
Thanks!
I chose the option to create context-sensitive help. I can manually open the
CHM file and it looks fine. But when I either hit F1 or click the Help
button (ID_HELP) in my dialog box, I get a message box that says "Failed to
launch help."
After considerable time, I've managed to isolate the routine that is
failing. AfxHtmlHelp() loads hhctrl.ocx and gets the function address for
"HtmlHelpW". Both of these steps are successful. But when it calls
HtmlHelp() via the pointer, 0 is returned. And when that value of 0 is
returned back to CWnd::HtmlHelp(), the "Failed to launch help" message is
displayed.
One thing I didn't quite understand is that the hWnd argument sent to
AfxHtmlHelp() shows in the debugger as "hWnd = 0x00430638 {unused=0 }". As
you can see, it's not NULL but I don't know if the "unused" comment is just
because it's not accessible or what.
Does anyone have any ideas on this? I don't know a whole lot about HTML help
but this is the main dialog box created by the Wizards so I kind of figure
this would work right out of the box. I'm not sure where else to look.
Thanks!
--
Jonathan Wood
SoftCircuits
http://www.softcircuits.com
Jonathan Wood
SoftCircuits
http://www.softcircuits.com