How to add context sensitive help to an application
-------------------------------------------------------------------------------

See SDK help for more details:
Developer Library  Tools and Utilities  Context-sensitive help guide  
How to add context sensitivity to an application

In the rtf source file the process is:
1. Create a new line before the topic text in the source rtf file.
2. Enter a string which describes the context for the particular topic.
3. Mark the context in Context style.
4. Repeat the above for each topic.
5. Build the project to create the CS help file (.hlp) and the CS help 
   C++ header file (.hlp.hrh)
	For example "My Context" in the source .rtf file translates to the following
	line in the .hlp.hrh file:
		_LIT(KMy_Context,"My_Context"); //My context comment

In a C++ application the process is:
1. Create the CCoeControl derived view or control for each context.
2. Overload the CCoeControl::GetHelpContext(TCoeHelpContext& aContext) function
   for the new control. The function should return a TCoeHelpContext which
   contains the UID of the help file and the literal descriptor for the 
   appropriate help topic context. This is all that is required to link 
   the control and the appropriate Help topic.
   		#include "$(basename).hlp.hrh"	// For CS help context IDs
		#include "$(basename)App.h"		// For application UID
		void CMyControl::GetHelpContext(TCoeHelpContext& aContext) const
		{
			aContext.iMajor = KUid$(basename);	// Application UID
			aContext.iContext = KMy_Context;	// TODO: Change this to reflect context defined in the .rtf file
		}
3. Overload the CCoeAppUi::HelpContextL() function in the AppUi to provide
   application level context sensitive help:
   		#include "$(basename).hlp.hrh"	// For CS help context IDs
		#include "$(basename)App.h"		// For application UID
		CArrayFix<TCoeHelpContext>* C$(basename)AppUi::HelpContextL() const
		{
			CArrayFixFlat<TCoeHelpContext>* array = new (ELeave) CArrayFixFlat<TCoeHelpContext>(1);
			CleanupStack::PushL(array);
			// Application UID + matching context defined in the .hlp.hrh file
			array->AppendL(TCoeHelpContext(KUid$(basename), KContextApplication));
			CleanupStack::Pop(array);
			return array;
		}
4. Add code to show the help, for example in the HandleCommandL() function of
   your AppUi:
		#include <hlplch.h>	// For HlpLauncher, link against hlplch.lib
		// Fetch a list of relevant contexts within an application help file.
		// The array is generated from the application user interface and the
		// controls on the control stack.
		CArrayFix<TCoeHelpContext>* helpContext = CCoeAppUi::AppHelpContextL();
		HlpLauncher::LaunchHelpApplicationL(iEikonEnv->WsSession(), helpContext);
5. Add the hlplch.lib library (for HlpLauncher) to the project build configuration
6. Compile the application

Note: Known Issues
-------------------------------------------------------------------------------
Embedded images within CS help files are not currently supported by the S60
platform. Instructions on how to add images is given in the SDK documentation
but although the help files will compile, no images will be displayed.

There is a problem when using certain versions of Microsoft Word to edit the
.rtf file. Word adds a tag that the CS Help compiler rejects and returns
This can be fixed by using an editor to remove the offending tag:
	{\*\generator Microsoft Word 10.0.6612;}
A complete list of all versions of Word that cause this problem is not
available, but it is a known problem with Microsoft Word 2002 v10.x.x.

For more information please see the following document at Forum Nokia:
Technical Note: Symbian OS: Known Issues In Creating Context-Sensitive Help
http://www.forum.nokia.com/

