blarivie
asked on
HtmlHelp(): how to use HH_HELP_CONTEXT and HH_KEYWORD_LOOKUP
I am experiencing several problems using the function HtmlHelp() in my MFC application.
I overridden WinHelp() in my mainframe class and commented out the call to WinHelp(). Now, I try to use HtmlHelp() instead.
The following call shows the default topic as expected:
HWND hwnd=HtmlHelp(pWnd->m_hWnd , "c:\\MyHelp\\MyHelp.chm", HH_DISPLAY_TOPIC, NULL);
I can even display a specific HTM file:
HWND hwnd=HtmlHelp(pWnd->m_hWnd , "c:\\MyHelp\\MyHelp.chm", HH_DISPLAY_TOPIC, (DWORD)((LPCTSTR)"MyTopic. htm"));
But, I didin't manage to reach a specific topic using an ID:
HWND hwnd=HtmlHelp(pWnd->m_hWnd , "c:\\MyHelp\\MyHelp.chm", HH_HELP_CONTEXT, HID_BASE_RESOURCE+ID_FILE_ OPEN);
I get an error message: "HH_HELP_CONTEXT called without a [MAP] section". But I have a [MAP] section in my help project file.
I have the same problem with HH_KEYWORD_LOOKUP. I read the documentation many times but, without a sample I cannot understand how it should work.
Any (html)help will greatly appreciated! ;-)
I overridden WinHelp() in my mainframe class and commented out the call to WinHelp(). Now, I try to use HtmlHelp() instead.
The following call shows the default topic as expected:
HWND hwnd=HtmlHelp(pWnd->m_hWnd
I can even display a specific HTM file:
HWND hwnd=HtmlHelp(pWnd->m_hWnd
But, I didin't manage to reach a specific topic using an ID:
HWND hwnd=HtmlHelp(pWnd->m_hWnd
I get an error message: "HH_HELP_CONTEXT called without a [MAP] section". But I have a [MAP] section in my help project file.
I have the same problem with HH_KEYWORD_LOOKUP. I read the documentation many times but, without a sample I cannot understand how it should work.
Any (html)help will greatly appreciated! ;-)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I don't know what exactly the problem is. You may try specifying a .HHK file.
For the 4th parameter, you'd better use the following since you use LPCTSTR.
(DWORD)((LPCTSTR)_T("MyStr ing"))
For the 4th parameter, you'd better use the following since you use LPCTSTR.
(DWORD)((LPCTSTR)_T("MyStr
ASKER
Thank you chensu for your help. I tried all kind of things but I still cannot use HH_KEYWORD_LOOKUP. I didn't find anything on this subject. It's probably too early to use Html help.
ASKER
But, I still cannot use HH_KEYWORD_LOOKUP.
It works when I test it with HTML Help Workshop (Menu Test/Keyword Lookup...). But I don't know how to do it programmatically. I tried the following without success:
HWND hwnd=HtmlHelp(pWnd->m_hWnd