2

I'm trying to add some help to my GUI developed in VC++ 2008. I want to compile a chm file, or a hlp file that can be accessed from my menu. Anyone can give me any idea about how to do this?

Thanks a lot

latonz
  • 1,601
  • 10
  • 21
deb
  • 425
  • 1
  • 9
  • 24
  • It's not clear from your question if you are asking about creating a .CHM, or simply opening an already created one (or both?). Perhaps you could clarify. –  Aug 04 '09 at 13:28

4 Answers4

3

You could just ShellExecute the .chm file. That will open it.

ShellExecute( hWnd, _T( "open" ), _T( "help.chm" ), NULL, NULL, SW_NORMAL );
Goz
  • 61,365
  • 24
  • 124
  • 204
3

Under HKLM\Software\Microsoft\Windows\HTMLHelp , create an entry
named help.chm
value C:\path to\help file.chm

Then to open the chm at a particular topic call

 HtmlHelp(m_hWnd, "Help.chm", HH_DISPLAY_TOPIC, NULL);
Martin Beckett
  • 94,801
  • 28
  • 188
  • 263
0

Sorry, I misunderstood your question earlier.

For opening the Help file, you can use WinHelp

Some Links:

First (PDF)
Second
Third

There are some issues with WinHelp in Windows Vista and Win2K8, For details on how to deal with them, Look here

Aamir
  • 14,882
  • 6
  • 45
  • 69
0

If you are using managed C++:

In the namespace

System.Windows.Forms

you can find the class Help with static methods ShowHelp, ShopHelpIndex

More info: http://msdn.microsoft.com/en-us/library/system.windows.forms.help.aspx

If you are using unmanaged C++ (WIN32 api):

You can just launch the *.chm file. Example how to do it you can find here: How do I call ::CreateProcess in c++ to launch a Windows executable? . Or here http://www.codeproject.com/KB/system/newbiespawn.aspx

Community
  • 1
  • 1
Perica Zivkovic
  • 2,610
  • 24
  • 32