Hi guys,
I am adding a menu item to P3Ds menu. With SimConnect, this is automatically added to P3Ds Add-Ons menu item as a child. But now, with the PDK method, the menu item is placed directly in the main menu bar, which I don't want. So, is it somehow possible to retrieve the MenuID of an existing menu item (Add-Ons) to pass it to AddItem as parent argument?
All the best, Benny
P3D::PdkServices::GetMenuService()->AddItem with unknown parent MenuID
- Beau Hollis
- Lockheed Martin
- Posts: 2452
- Joined: Wed Oct 06, 2010 3:25 pm
Re: P3D::PdkServices::GetMenuService()->AddItem with unknown parent MenuID
I believe you can use ADDON_ITEM_ID. The menu IDs for all the top level items are listed in the MenuService header:
Thanks#define NO_PARENT 0x0000
#define SCENARIO_ITEM_ID 0x1001
#define VEHICLE_ITEM_ID 0x1002
#define WORLD_ITEM_ID 0x1003
#define OPTIONS_ITEM_ID 0x1004
#define VIEWS_ITEM_ID 0x1005
#define HELP_ITEM_ID 0x1006
#define WINGMEN_ITEM_ID 0x1008
#define TOOLS_ITEM_ID 0x100d
#define TEST_ITEM_ID 0x100e
#define ADDON_ITEM_ID 0x1010
#define ANALYSIS_ITEM_ID 0x1011
#define NETWORK_ITEM_ID 0x1012
#define NAVIGATION_ITEM_ID 0x1013
#define ALL_CHILDREN 0xFFFF
Beau Hollis
Prepar3D Software Architect
Prepar3D Software Architect
Re: P3D::PdkServices::GetMenuService()->AddItem with unknown parent MenuID
Thanks Beau for your reply and the hint for the defines.
SCENARIO_ITEM_ID or ANALYSIS_ITEM_ID are working fine as parent MenuID. ADDON_ITEM_ID doesn't work, though. Produces a HRESULT of E_FAIL.
Greets, Benny
SCENARIO_ITEM_ID or ANALYSIS_ITEM_ID are working fine as parent MenuID. ADDON_ITEM_ID doesn't work, though. Produces a HRESULT of E_FAIL.
Greets, Benny
Re: P3D::PdkServices::GetMenuService()->AddItem with unknown parent MenuID
So, unfortunately this still produces the above mentioned error in 4.5 on my side. Not able to add a menu item to the Addon submenu.
All the best,
Benny
All the best,
Benny
Re: P3D::PdkServices::GetMenuService()->AddItem with unknown parent MenuID
I can confirm that using the latest SDK/PDK it is still not working using follwoing code:
Code: Select all
MenuService->AddItem(MenuItemAIG->GetId(), ADDON_ITEM_ID, 0);
Re: P3D::PdkServices::GetMenuService()->AddItem with unknown parent MenuID
Hi guys,
just wanted to chime in that also with Prepar3D v4 SDK 4.5.13.32097 this doesn't seem to be fixed.
Greets,
Benny
just wanted to chime in that also with Prepar3D v4 SDK 4.5.13.32097 this doesn't seem to be fixed.
Greets,
Benny