You receive a "No help ID matches control ID # 0" error message when you right-click on a dialog box for context-sensitive help (822331)
The information in this article applies to:
- Microsoft Visual C++ Standard Edition, version 6.0
SYMPTOMS When you use "What's This Help" by calling the HTMLHelp API
and by choosing the context-sensitive help option in your project, you may
receive the following error message in a dialog box if you right-click on a
dialog box and if the pointer is not over the control that contains
context-sensitive help: HH_TP_HELP_WM_HELP/HH_TP_HELP_CONTEXTMENU: No help ID matches
control ID # 0
If you right-click the dialog box when the pointer is
over one of the controls that contains context-sensitive help, the error
message does not appear. CAUSEThis problem occurs because the Help ID for the control ID
#0 is not present in the HTML Help file. Because no control ID exists for a
dialog box, right-clicking on a dialog box when the pointer is not over the
control causes the error message that is mentioned in the "Symptoms" section of
this article.RESOLUTIONTo resolve this problem, use the GetDlgCtrlID method in the OnContextMenu handler to get the control ID, and then call the HTMLHelp API
only if the control ID is greater than 0. For more information, see the
following code: void CMyhelpDlg::OnContextMenu(CWnd* pWnd, CPoint point)
{
static DWORD myarray[] = {
IDC_APPLY, 1,
IDC_RADIO1, 2,
0,0
};
int control_id = pWnd->GetDlgCtrlID();
if (control_id > 0) {
::HtmlHelp(
pWnd->GetSafeHwnd(),
"hlp\\Myhelp.chm::/dlgctrl.txt",
HH_TP_HELP_CONTEXTMENU,
(DWORD)(LPVOID)myarray);
}
} STATUS This
behavior is by design.REFERENCESFor more information about creating context-sensitive help
text files, visit the following Microsoft Developer Network (MSDN) Web site:
Modification Type: | Major | Last Reviewed: | 2/9/2004 |
---|
Keywords: | kberrmsg kbHTMLObj kbDlg kbAPI kbAppWizard kbCSHelp kbprb KB822331 kbAudDeveloper |
---|
|