Solved

How to change what the help file is?

Posted on 2006-11-19
4
203 Views
Last Modified: 2013-11-20
I have a program, Sample.exe, developed with MFC in VC 6.0. I use a Sample.rtf to build a Sample.hlp. This is used when the user hits Help>Contents, and also when the user hits F1 on any screen.

For international localization, during execution I need to be able to swtich to a different help file, Sample_French.hlp under program control.

How do I do this?
0
Comment
Question by:DickStone
  • 2
4 Comments
 
LVL 5

Expert Comment

by:Alkali_Guy
ID: 17977145
You can override the WM_HELPINFO (OnHelpInfo) handler and use the WinHelp function to open the help file you want.  If selecting the help menu item does not open the correct file, you can replace that handler with your own as well, and have it call the same OnHelpInfo handler.  There may be some remaining stickiness associated with context-sensitive help.  E.g.:

WinHelp(m_hWnd, "C:\FooApp\Sample.hlp", HELP_CONTENTS, 0);
0
 
LVL 5

Accepted Solution

by:
Alkali_Guy earned 400 total points
ID: 17977205
This PDF explains a more general way to reroute help functionality.  It focuses on adapting a project for HtmlHelp, but the principle is the same.  Apparently you have to override CFrameWnd::WinHelp.

http://www.smountain.com/resource/CPPHTMLHelp.pdf
0
 
LVL 22

Expert Comment

by:mahesh1402
ID: 17977253
Whats exact problem ? Regarding invoking right help file on langauge detection ??

Note that you can just keep all .hlp files in one folder under your application installation path and runtime copy needed file as Sample.hlp to invoke same everytime when you detect your language-id. You may just use CopyFile() to copy file and on application exit delete the same using DeleteFile()/CFile::Remove().


-MAHESH
0
 

Author Comment

by:DickStone
ID: 17980101
Yes -- I'm trying to switch to a French hep file when it detects that French is the dialog/messages language.

The CopyFile is the easiest solution, but would have to be done for both English and French -- slowing the startup.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

809 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