[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


How to switch solution from WinHelp to HtmlHelp

Posted on 2005-04-29
Medium Priority
Last Modified: 2013-11-20
Hi experts,
I am working on a CDialog based application which I set to using
WinHelp as context help.
Now after a lot of coding the application works, but I would like
to switch to HtmlHelp in order to create my documentation.

also check this:

Question by:allmer
  • 4
  • 3
LVL 14

Expert Comment

ID: 13897450
What version of VC++ are you using?
LVL 14

Expert Comment

ID: 13897608
For Vc++.Net (7.1) it looks like all you need to do is add a call to


in your app class constructor.

Author Comment

ID: 13900428
I am using MS Dev Environment version 7.1.3088.
I will try the EnableHtmlHelp right now ;)
I guess there should be a EnableWinHelp, I will have to get rid off, too.
Hmm, there was nothing in there.
Could that lead to problems?
Should I delete all Winhelp related files (.hlp,...)?
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.


Author Comment

ID: 13900442
Hi wayside,
breaks here on exit:
+ It didn't create the files that should be created when HtmlHelp is used.
There must be some more things I have to set-up.
Any ideas?

void CWnd::WinHelp(DWORD_PTR dwData, UINT nCmd)
      CWinApp* pApp = AfxGetApp();
      ASSERT(pApp->m_pszHelpFilePath != NULL);
      ASSERT(pApp->m_eHelpType == afxWinHelp);

      CWaitCursor wait;


      // need to use top level parent (for the case where m_hWnd is in DLL)
      CWnd* pWnd = GetTopLevelParent();

      TRACE(traceAppMsg, 0, _T("WinHelp: pszHelpFile = '%s', dwData: $%lx, fuCommand: %d.\n"),
            pApp->m_pszHelpFilePath, dwData, nCmd);

      // finally, run the Windows Help engine
      if (!::WinHelp(pWnd->m_hWnd, pApp->m_pszHelpFilePath, nCmd, dwData))
LVL 14

Expert Comment

ID: 13908514
I generated a new dialog app from scratch, and selected html help in the wizard.

The only code difference I saw was the call to EnableHtmlHelp() added to the app constructor.

The files in the hlp directory are different - for a WinHelp app, there was afxdlg.rtf, a .cnt file, and a .hpj file. For the html help app, there is a HIDD_ROOT_DIALOG.htm, a .hcc, a .hhk, and a .hhp file. Perhaps this is where your trouble is.


Author Comment

ID: 13908684
that's not the problem. It compiles and runs without problem,
but it fails on exit.
There is an assertion in wincore.cpp as seen above.
ASSERT(pApp->m_eHelpType == afxWinHelp);
So at some point in the project there must be a setting telling
VS which help to use.
Maybe in the solution, the resource, ..
It should also now which help compiler to use (produce a .hlp or a .chm file)..
Any ideas?
LVL 14

Accepted Solution

wayside earned 1000 total points
ID: 13908906
This information about which help coompiler to use, and the commands to build the help file, are buried in the .vcproj file, and that's some ugly looking stuff. I think he easiest way to get this working right would be to:

1) rename your project directory to another name
2) create a new project with the original name, specifying html help this time
3) copy the source  and resource files from the old directory into the new one, and add any new files back into the project

This will take < 5 minutes, and will be a heck of a lot easier than trying to muck with the .vcproj file.

> There is an assertion in wincore.cpp

Are you calling CWnd::WinHelp() directly in your code, or using it in a message map function? There is a CWnd::HtmlHelp() function which you should use instead.


Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Ready to get certified? Check out some courses that help you prepare for third-party exams.
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.
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

873 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