What`s this html help for my application
-
I would like to use the what`s this html help for my application but I can not add additional help for my views or buttons. The automatically created help for the menue and so on works. What I tried is: In the help folder there is a .hpp file. There I added a new Help Homepage. I added the HP to the topics. There is a HTMLDefines.h file as well in the hlp folder. There I added a define to my IDC_BUS in my application. In the application: I created: void CMainFrame::HtmlHelp(DWORD_PTR dwData, UINT nCmd) { CGuiFrameWnd::HtmlHelp(dwData, nCmd); } When I debugged the project CGuiFrameWnd::HtmlHelp(dwData,nCmd) is called. inside CWinApp* pApp = AfxGetApp(); ASSERT_VALID(pApp); ASSERT(pApp->m_pszHelpFilePath != NULL); // to call HtmlHelp the m_fUseHtmlHelp must be set in // the application's constructor ASSERT(pApp->m_eHelpType == afxHTMLHelp); CWaitCursor wait; PrepareForHelp(); // need to use top level parent (for the case where m_hWnd is in DLL) CWnd* pWnd = GetTopLevelParent(); TRACE(traceAppMsg, 0, _T("HtmlHelp: pszHelpFile = '%s', dwData: $%lx, fuCommand: %d.\n"), pApp->m_pszHelpFilePath, dwData, nCmd); // run the HTML Help engine if (!AfxHtmlHelp(pWnd->m_hWnd, pApp->m_pszHelpFilePath, nCmd, dwData)) AfxMessageBox(AFX_IDP_FAILED_TO_LAUNCH_HELP); happens. My mapping ID to Help does not work. Can you please help me what I have to do? Thank you
-
I would like to use the what`s this html help for my application but I can not add additional help for my views or buttons. The automatically created help for the menue and so on works. What I tried is: In the help folder there is a .hpp file. There I added a new Help Homepage. I added the HP to the topics. There is a HTMLDefines.h file as well in the hlp folder. There I added a define to my IDC_BUS in my application. In the application: I created: void CMainFrame::HtmlHelp(DWORD_PTR dwData, UINT nCmd) { CGuiFrameWnd::HtmlHelp(dwData, nCmd); } When I debugged the project CGuiFrameWnd::HtmlHelp(dwData,nCmd) is called. inside CWinApp* pApp = AfxGetApp(); ASSERT_VALID(pApp); ASSERT(pApp->m_pszHelpFilePath != NULL); // to call HtmlHelp the m_fUseHtmlHelp must be set in // the application's constructor ASSERT(pApp->m_eHelpType == afxHTMLHelp); CWaitCursor wait; PrepareForHelp(); // need to use top level parent (for the case where m_hWnd is in DLL) CWnd* pWnd = GetTopLevelParent(); TRACE(traceAppMsg, 0, _T("HtmlHelp: pszHelpFile = '%s', dwData: $%lx, fuCommand: %d.\n"), pApp->m_pszHelpFilePath, dwData, nCmd); // run the HTML Help engine if (!AfxHtmlHelp(pWnd->m_hWnd, pApp->m_pszHelpFilePath, nCmd, dwData)) AfxMessageBox(AFX_IDP_FAILED_TO_LAUNCH_HELP); happens. My mapping ID to Help does not work. Can you please help me what I have to do? Thank you
MFC code always adds some offsets for the controls and window, etc. to the resource ID, so you have to go through a mapping of your resource ID to help ID, and then use the help ID in your help project. Look at the MakeHM.Exe that comes with VC6, or else look for my CGMakeHM utility here at CodeProject - each one performs the mappings. People that start writing code immediately are programmers (or hackers), people that ask questions first are Software Engineers - Graham Shanks