HI Moja,
You have to pass your Menubar's Resoure Id in the form's ConstructL().
Your class (derived from CAknForm) 's ConstructL() should be like this...
void CMYForm::ConstructL(TInt aResourceID)
{
CAknForm::ConstructL(aResourceID);
}
This will show the default menus of Form with your own.
To remove the default Form Menus you have to use DynInitMenuPaneL()
Like this..
Code:
void CMYForm::DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane)
{
CAknForm::DynInitMenuPaneL(aResourceId,aMenuPane);
if (aResourceId == R_AVKON_FORM_MENUPANE)
{
aMenuPane->SetItemDimmed(EAknFormCmdLabel, ETrue);
aMenuPane->SetItemDimmed(EAknFormCmdAdd, ETrue);
aMenuPane->SetItemDimmed(EAknFormCmdDelete, ETrue);
aMenuPane->SetItemDimmed(EAknFormCmdEdit, ETrue);
}
}
Regards,
Kavit.