calling Html Help workshop from a C++ app, using keyword lookup
Posted on 2007-03-20
i am trying to use html help workshop to manage the help of my application.
the help file is working well, but I have a problem calling it from the C++ app.
HWND owner = theApp.GetMainFrame()->GetSafeHwnd();
query.cbStruct = sizeof(query);
query.fReserved = FALSE;
query.pszKeywords = (LPCSTR)p_Lookup;
query.pszUrl = NULL ;
query.pszMsgText = NULL ;
query.pszMsgTitle = NULL ;
query.pszWindow = NULL ;
query.fIndexOnFail = TRUE ;
m_HelpHandle = HtmlHelp(owner, m_HelpFileName, HH_DISPLAY_INDEX,0) ;
m_HelpHandle = HtmlHelp(owner, m_HelpFileName, HH_KEYWORD_LOOKUP,(DWORD)&query) ;
and i'd like the help file to open and point to the page talking about what is contained in "p_Lookup".
the help file opens correctly, and the keyword I am trying to lookup appears correctly in the index page, BUT the page itself is not displayed. (I have to press enter to display the selected entry).
to give a concrete example, I have a keyword "WaitWnd" in my help file. there is a page titled "WaitWnd", and there is an entry "WaitWnd" in the TOC, leading to this page.
when I run the lookup from the application, the help opens on the default page, but "WaitWnd" is already selected in the index tab. (as a result of query.fIndexOnFail = TRUE ; i guess), BUT the WaitWnd page is not displayed.
is there something I mistook? did you experience this situation before?