Solved

Context sensitive help in MFC app

Posted on 2009-06-29
6
567 Views
Last Modified: 2013-12-14
Hello,

I'm developing an MFC application that I'd like to provide context sensitive help for. Does MFC provide such a facility? I think that .chm files are deprecated in Windows vista - something called MAML is used instead.

My questions is, what is the modern, preferred way to create context sensitive help within MFC?

Regards,
Sternocera
0
Comment
Question by:sternocera
  • 3
  • 2
6 Comments
 
LVL 39

Expert Comment

by:itsmeandnobodyelse
Comment Utility
>>>> Does MFC provide such a facility?
Yes. If you create an MFC app by wizard, one of the default options you have is 'context sensitive help' switched on. It provides a menu entry in the help menu where the mouse cursor turns to an arrow with question mark upon top and where moving it to a control it could show help text if supplied by your application. It uses both the IDD of the dialog form and the IDC of the control to identify the text provided.

>>>> I think that .chm files are deprecated in Windows vista
Probably. Two points: Is your MFC app for Vista only? If yes you might consider changing to Windows Forms and .NET what surely has a more Vista like look-and-feel. Second, instead of chm you could switch to HTML help. There are a lot of tools which do both. Yoe easily can find them by googling for 'MFC help compiler HTML' or similar.
0
 

Author Comment

by:sternocera
Comment Utility
>>>> If yes you might consider changing to Windows Forms and .NET what surely has a more Vista like look-and-feel.

My MFC app has a perfect Vista look and feel (All the more so because of the Visual studio 2008 extensions). Changing over to windows forms or .NET isn't practical anyway. I have a large MFC codebase here.

.chm *is* HTML Help.

Since I did not originally specify that context sensitive help should be used, how can I retrofit chm help into my application?

Regards,
Sternocera

0
 
LVL 39

Accepted Solution

by:
itsmeandnobodyelse earned 125 total points
Comment Utility
>>>> Since I did not originally specify that context sensitive help should be used, how can I retrofit chm help into my application?
As told the context sensitive help generated by wizard is only a menu entry in the help menu. You may create two sample apps, one with context sensitive help on, one without and compare the generated code. It should be only the menu resource plus handler code.

The association between resource ids of dialog and controls with text are made by a batch command file mkhelp.bat (or similar). That would create a template for the help compiler out of your resource ids (afaik it is a .hm file it generates). To add more help you could write handlers for right-clicking on controls which would show some info text similar to a tooltip. That text was not provided from .chm but must be supplied by your prog.

>>>> .chm *is* HTML Help.
ok. But I am sure that there are other formats available as well. And probably it depends on the help compiler how the HTML help looks.

 
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 

Author Comment

by:sternocera
Comment Utility
itsmeandnobodyelse,

Thanks for that.

How can I actually invoke Html help from within MFC? I see that html workshop has a small C API bundled with it. I can spawn HTML help that way. However, I'd prefer to do so using CWnd::HtmlHelp. I cannot see to figure out what arguments I'm expected to supply to this function to get it to open a specific HTML help file.

Regards,
Sternocera
0
 
LVL 7

Assisted Solution

by:help-info
help-info earned 125 total points
Comment Utility
May be you want to have a look at:
http://www.smountain.com/resource/CPPHTMLHelp.pdf
or see following link and search for "HTMLHelp - Programming"
http://www.help-info.de/en/Help_Info_HTMLHelp/hh.htm

Best regards
Ulrich Kulle
Microsoft MVP - Help
0
 

Author Comment

by:sternocera
Comment Utility
I have succesfully called context sensitive help through CWnd::HtmlHelp. This is enough of a starting point for me. Plenty of current Apps use HTML help, so I'm happy enough to use it for the time being,

Thanks,
Sternocera
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

772 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now