Open the .cpp
file containing HandleCommandL(TInt aCommand)
.
Add a menu
item Ehelp
by adding the following code in HandleCommandL(TInt aCommand)
:
case EHelp: { if (FeatureManager::FeatureSupported(KFeatureIdHelp)) { CArrayFix<TCoeHelpContext> *buf = CCoeAppUi::AppHelpContextL(); HlpLauncher::LaunchHelpApplicationL(iEikonEnv->WsSession(), buf); } }You must also make appropriate standard arrangements for the Ehelp enum as you do for any menu item.
Add the HelpContextL()
function to define the topic that you want
to launch from the application.
The following code demonstrates how to define HelpContextL()
:
_LIT(KCXHELPHelloworld_HLP_SETTINGS, "SAMPLE_HLP_TOPIC_1"); CArrayFix<TCoeHelpContext>* CcshelphelloworldAppUi::HelpContextL() const { if (FeatureManager::FeatureSupported(KFeatureIdHelp)) { CArrayFixFlat<TCoeHelpContext>* array = new (ELeave) CArrayFixFlat<TCoeHelpContext> (1); CleanupStack::PushL(array); array->AppendL( TCoeHelpContext(KUidcshelphelloworldApp, KCXHELPHelloworld_HLP_SETTINGS)); CleanupStack::Pop(array); return array; } else { return NULL; } }
The preceding code snippet uses feature manager harness mechanism
to launch a help topic from the Symbian application. If you want to
use this mechanism, make sure you include <featmgr.h>
and link LIBRARY featmgr.lib
in your MMP file.
The Application UID of the application which needs to launch the application help must be in the protected range. For information on protected and unprotected range of UIDs, see UID Q & A (Symbian Signed).
Integrate the application help with your Symbian application. For details, see Integrating and testing the application help.
The device user can now launch the specific help topic from the Symbian application by performing the following steps: