HtmlHelp with VC6 ?
-
I thought this was going to be an easy one since the MSDN documentation seems to indicate that there is a CWinApp::HtmlHelp() member function. I have a feeling the MSDN I am using is meant for use with a newer version of Visual Studio 6. My CWinApp header does not have such a member function. Is there any other way to use Html Help in a VC6 project? I don't need to build the chm's - I just want to be able to call them (replace CWinApp::WinHelp()). Thanks, Dave
-
I thought this was going to be an easy one since the MSDN documentation seems to indicate that there is a CWinApp::HtmlHelp() member function. I have a feeling the MSDN I am using is meant for use with a newer version of Visual Studio 6. My CWinApp header does not have such a member function. Is there any other way to use Html Help in a VC6 project? I don't need to build the chm's - I just want to be able to call them (replace CWinApp::WinHelp()). Thanks, Dave
I'm going to reply to my own question. It drives me nuts when people just say: never mind, I figured it out and leave it at that. Here's what I ended up doing: In my CXXXApp (CWinApp derived class), I override WinHelp() and replace WinHelp() with the following:
//CWinApp::WinHelp(dwData,nCmd); CString szFile(m_pszHelpFilePath); char drive[_MAX_DRIVE]; char dir[_MAX_DIR]; char fname[_MAX_FNAME]; char ext[_MAX_EXT]; _splitpath(szFile,drive,dir,fname,ext); CString szChm; szChm.Format("%s%s%s.chm",drive,dir,fname); nCmd = HH_HELP_CONTEXT; ::HtmlHelp(AfxGetMainWnd()->m_hWnd,szChm,nCmd,dwData);
I needed to have the platform SDK installed to get the htmlhelp.h and .lib files. With those added to my project, the help seems to work identically to the way it did with WinHelp (jumps to the right topic,...). If you see something that I may have overlooked or could be doing better, please let me know.