Link to home
Start Free TrialLog in
Avatar of DickStone
DickStone

asked on

How to change what the help file is?

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?
Avatar of Alkali_Guy
Alkali_Guy

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);
ASKER CERTIFIED SOLUTION
Avatar of Alkali_Guy
Alkali_Guy

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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
Avatar of DickStone

ASKER

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.