How to switch solution from WinHelp to HtmlHelp

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:
http://www.experts-exchange.com/Programming/Q_21405805.html

Thanks,
Jens
LVL 5
allmerAsked:
Who is Participating?
 
waysideConnect With a Mentor Commented:
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.





0
 
waysideCommented:
What version of VC++ are you using?
0
 
waysideCommented:
For Vc++.Net (7.1) it looks like all you need to do is add a call to

      EnableHtmlHelp();


in your app class constructor.
0
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

 
allmerAuthor Commented:
Hi,
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,...)?
Thanks,
Jens
0
 
allmerAuthor Commented:
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_VALID(pApp);
      ASSERT(pApp->m_pszHelpFilePath != NULL);
      ASSERT(pApp->m_eHelpType == afxWinHelp);

      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("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))
            AfxMessageBox(AFX_IDP_FAILED_TO_LAUNCH_HELP);
}
0
 
waysideCommented:
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.

0
 
allmerAuthor Commented:
Hmm,
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?
Jens
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.