- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I try to add a popup-menu to the LinearMarkingMenu without success:
HRESULT EventClass::OnLinearMarkingMenu( struct Inv::ObjectsEnumerator * SelectedEntities,
enum Inv::SelectionDeviceEnum SelectionDevice,
struct Inv::CommandControls * LinearMenu,
struct Inv::NameValueMap * AdditionalInfo )
{
if (Inv::kBrowserSelection != SelectionDevice) // add this only at browser window
{
return S_FALSE;
}
Inv::CommandControlPtr pCC;
Inv::ObjectCollectionPtr pObjectCollection;
Inv::TransientObjectsPtr pTransientObjects;
hr = m_pApplication->get_TransientObjects(&pTransientObjects);
if (S_OK == hr && NULL != pTransientObjects)
{
hr = pTransientObjects->CreateObjectCollection(_variant_t(), &pObjectCollection);
hr = pObjectCollection->Add(pEditCmd); // pEditCmd is a Inv::ButtonDefinitionObjectPtr, it is a valid object, checked before
// if I try this
hr = LinearMenu->AddPopup(pBDO, pObjectCollection, VARIANT_FALSE, VARIANT_TRUE, _bstr_t(L""), VARIANT_FALSE, &pCC);
// i get hr == E_FAIL
hr = LinearMenu->AddButton(pBDO, VARIANT_FALSE, VARIANT_TRUE, _bstr_t(L""), VARIANT_FALSE, &pCC); // <- this works
// if I try to get the child controls, to add a button
// Inv::CommandControlsPtr pCCs;
// hr = pCC->get_ChildControls(&pCCs);
// hr == S_OK but pCCs == NULL
So what can I do to add a PopupMenu in this situation?
Or what I'm doing wrong?
Win7x64
Inventor2014SP2
Solved! Go to Solution.