Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - 2ben7

Pages: [1]
1
wanna push


2
Hi,

i get following exception(in Debug Mode of Visual Studio2010 c# plugin)
by closing EA9.3:

An exception was caught but handled while releasing a COM interface pointer through Marshal.Release or Marshal.ReleaseComObject or implicitly after the corresponding RuntimeCallableWrapper was garbage collected. This is the result of a user refcount error or other problem with a COM object's Release. Make sure refcounts are managed properly.  The COM interface pointer's original vtable pointer was 0x1766ef8. While these types of exceptions are caught by the CLR, they can still lead to corruption and data loss so if possible the issue causing the exception should be addressed

I thought this code may be the problem:

public void EA_Disconnect()
{
            GC.Collect();
            GC.WaitForPendingFinalizers();
}

I also tried to comment out both GC-calls. Same error.

Whats the problem ?
I don`t want to just disable some MDA-Assistent checkboxes, to get away the error !!!

interesting
I just tested it with EA7.1 -> no exception
                             EA9.3 -> exception
No code changes done. Anything im not allowed to do in EA9.3 on quiting ?

3
thx in combination with ContextItemChanged, i could work it out !

Quote
(sorry about x-posting)
What you could to is to start a timer in a separate thread that triggers an update of the control.

Alternatively instead of a timer just set a reload flag and catch the EA_OnContextItemChanged event that fires after each EA_OnPreDelete... event when deleting using the project browser. i think it will get fired after the element is destroyed so that would be a good moment to check the reload flag and refresh your control  8-).

best regards,

Paulus

4
Hi Paul,

but u forgot one nice problem :),
btw: i agree to what you said and i know the difference.

This event gets not triggered, if there are 2 diagrams in a Package. If i delete the package (which also result that the diagrams get deleted) i receive NO EA_OnPreDeleteDiagram event ->
EA_OnPreDeletePackage is triggered. So i don`t know which diagrams are updated.

So my great idea was to invoke SQL Query command again, but this result in the timing issues i described for my topic.

Yes, at the moment i use all 3 types of Delete methods.

Any ideas ?

Quote
A diagram is not the same as an element, you need to catch EA_OnPreDeleteDiagram for that  ;)

regards,

Paulus

5
Yes i can explain the use case in more detail.
I have a control in my addin, which list all current diagrams of the model.

When i recognize, that there are one or more diagrams deleted
(even whole packages with several uncount diagrams inside),
i execute the fast SQLQuery("get all diagrams id`s or name from model")
to update the list to its current state.

I use EA_OnPreDeleteElement for this.

But as it seems, there is no valid reliable event, i can use to be sure, when Repository is really upated.

6
Hallo,

i can need your help again. Would appreciate it.

What i have to do, to recognize a deleted element from the Repository ?
Im using EA_OnPreDeleteElement. But as the docu says, the event raises BEFORE it gets deleted from the Repository.

At the moment, i react for my plugin in this method. But if i do a SQL Query at the actual Repository(from the argument parameter list of the method), it is not always
secure, that the Element is still deleted from the repository.

How can i prevent this run condition ?
Also there is no EA_OnPostDeleteElement -EventMethod :(

7
yeah, but it was not called on switching.
Her is my usage:

public void EA_QueryAvailableCompartments(Repository repository)
{
      // should be called on still opened (Diagram/Subdiagram) switch      
}

8
i tried the event.
When i start EA 9.3 the event is called only once until the project is loaded.

But if i open several new not opened diagrams -> event not called
if i switch between the opened diagrams -> also not called

9
that would make it.... difficult.
Not suggest that there is nothing like this existing.

I have another idea: is it at least possible to get an event
of all opened diagrams, so i would iterate through all diagrams, if i
switch through still opened diagrams ?

10
Hi,

this event works if Diagram is not still open. But how to i recognize a switching between different still opened diagrams ? I can`t find a suitable event.

thx
 ben

Pages: [1]