Revision as of 02:41, 30 May 2013 by hamishwillee (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Accessing the menu bar of Symbian C++ dialog-based applications returns a null pointer (Known Issue)

From Nokia Developer Wiki
Jump to: navigation, search

Accessing the menu bar of Symbian C++ dialog-based applications, for example to modify menu contents at runtime, returns a null pointer if no menu bar is defined in resources.

Article Metadata
Tested with
Devices(s): All (S60)
Keywords: MenuBar()
Created: User:Kbwiki (23 Nov 2009)
Last edited: hamishwillee (30 May 2013)


CEikonEnv::Static()->AppUiFactory()->MenuBar() can be used in an S60 UI application to access the menu bar (a pointer to the CEikMenuBar instance), defined in the EIK_APP_INFO resource as follows:

menubar = r_myapp_menu_bar; /* a link to a MENU_BAR resource */

A dialog-based application that omits the menubar definition will receive a null pointer when trying to access the menu bar using the above function.


Define a menu bar in the EIK_APP_INFO resource for a dialog-based application, then use the following buttons definition in the DIALOG resource:

 RESOURCE DIALOG r_myapp_main_dialog

As a result, the menu bar (Options menu) can be accessed with CEikonEnv::Static()->AppUiFactory()->MenuBar().

See also

See S60 Platform: Time Zone Localiser Example for an example of a dialog-based application.

This page was last modified on 30 May 2013, at 02:41.
70 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.


Thank you!

We appreciate your feedback.