BMenu* menu = new BMenu("File"); BMenuItem* item1 = new BMenuItem("Open", new BMessage(M_OPEN)); menu->AddItem(item1); BMenuItem* item2 = new BMenuItem("Save", new BMessage(M_SAVE)); menu->AddItem(item2);In this example, a new BMenu object is created with the name "File". Two new BMenuItem objects are created with the labels "Open" and "Save" and messages M_OPEN and M_SAVE respectively. These items are then added to the menu with the AddItem function. This code example demonstrates the basic usage of the BMenu class in C++. It is important to note that this code requires the BeAPI library to be included in the project.