Book a Demo

Author Topic: EA crashes when I try to use ShowInProjectView()  (Read 14824 times)

Robert B.

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: EA crashes when I try to use ShowInProjectView()
« Reply #15 on: June 07, 2019, 05:57:59 pm »
I know I might be a bit late on this but as I have the very same issue today others may also constantly stumble upon. I'm using EA Full 12.1.1229.

To shortly summarize the essence: EA crashes when confronted with the following code:
Code: [Select]
public bool EA_OnContextItemDoubleClicked(EA.Repository, String guid, EA.ObjectType)
{
..
            Repository.ShowInProjectView( e );  //e differs from the element referenced by guid
..
}

As we know "EA_OnContextItemDoubleClicked" can be caused by several different user interactions. The mentioned crash is only encountered when the EA_OnContextItemDoubleClicked was fired by a double-click in the project tree. Whenever fired by a double-click on the element in a diagram, context-menu->Properties, Alt+Enter Short-Cut everything is fine. Probably EAs internal "tree-control-double-click-handler" doesn't like changing a "tree-control-state".

Sadly there seems to be no easy way to determine, from which aspect of the GUI the EA_OnContextItemDoubleClicked was caused.


Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: EA crashes when I try to use ShowInProjectView()
« Reply #16 on: June 07, 2019, 08:31:52 pm »
Sadly there seems to be no easy way to determine, from which aspect of the GUI the EA_OnContextItemDoubleClicked was caused.
You could use Repository.GetTreeSelectedItem to figure out if the context item is the one selected in the project browser.
If it is, there's a fair chance the event was launched from the project browser.

Geert

Robert B.

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: EA crashes when I try to use ShowInProjectView()
« Reply #17 on: June 07, 2019, 10:11:38 pm »
Ok! So for a given EA_OnContextItemDoubleClicked I can't be 100% sure whether the user has clicked the tree but I can safely determine for a given event that s/he hasn't used the tree and use ShowInProjectView only in that cases...  good enough I would say.

Tried it and worked. Thanks!