Solved

HtmlHelp(): how to use HH_HELP_CONTEXT and HH_KEYWORD_LOOKUP

Posted on 1998-08-26
4
1,459 Views
Last Modified: 2013-11-20
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! ;-)

0
Comment
Question by:blarivie
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 23

Accepted Solution

by:
chensu earned 250 total points
ID: 1321332
Hope these help.

HOWTO: Prepare HTML Help Files for Context-Sensitive Help
http://support.microsoft.com/support/kb/articles/q189/4/53.asp

HOWTO: Create Context-Sensitive HTML Help in an MFC Application
http://support.microsoft.com/support/kb/articles/q191/1/18.asp

BUG: Editing MAP or ALIAS in the HTML Help Workshop Causes Error
http://support.microsoft.com/support/kb/articles/Q188/4/44.asp
0
 

Author Comment

by:blarivie
ID: 1321333
Thank you very much! You resolved half of my problem.  Now, I understand how [MAP] and [ALIAS] work so I can use HH_HELP_CONTEXT.

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, NULL, HH_KEYWORD_LOOKUP, (DWORD)((LPCTSTR)"MyString"));

0
 
LVL 23

Expert Comment

by:chensu
ID: 1321334
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("MyString"))
0
 

Author Comment

by:blarivie
ID: 1321335
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.  
0

Featured Post

Enroll in June's Course of the Month

June’s Course of the Month is now available! Experts Exchange’s Premium Members, Team Accounts, and Qualified Experts have access to a complimentary course each month as part of their membership—an extra way to sharpen your skills and increase training.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question