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 - Knut Paulsen

Pages: 1 2 3 [4] 5 6
46
It happened again, but this time without the NullReferenceException, so apparently it has nothing to do with this problem.

The code line is inside a method that searches through an EA package for a package with a specific name and I do notice that the package I am looking for is the same one as the last time it failed, which indicates that it might be my fault :-)

47
Hi guys,

I'm getting into a habit of running into problems every friday afternoon :-)

I wonder if any of you have ever seen this behavior before:
I am running a debug session in VS Express 2012 for Windows Desktop.
I have a pretty long running task of importing stuff into EA, and sometimes, not always, it stops. The code is within a try/catch block, but it appears not to be an exception that I can catch. I get a dialog box telling me something bad has happened, full content is copied below. Apparently a thread has stopped for some reason that I do not understand and it is not my main working thread. If I switch to my thread in the debugger the topmost frames on the call stack are just presented as '[External code]' and the first frame that is 'mine' is busy with this statement: foreach (EA.Package package in parent.Packages).

I do notice that the output window says a NullReferenceException occurred in my program, but the parent variable in my code line is NOT null and I have already imported dozens of packages and elements into it. So form what I can see, this NullReferenceException must occur inside Enterprise Architect code.

Any ideas?

Full error description from VS:
A first chance exception of type 'System.NullReferenceException' occurred in IREAWizard.exe
The thread '<No Name>' (0x221c8) has exited with code 0 (0x0).
Managed Debugging Assistant 'DisconnectedContext' has detected a problem in 'C:\My Projects\TOOLSBYKNUT\IREA\IREAWizard\bin\Debug\IREAWizard.vshost.exe'.
Additional Information:
Transition into COM context 0x874478 for this RuntimeCallableWrapper failed with the following error:
  System call failed. (Exception from HRESULT: 0x80010100 (RPC_E_SYS_CALL_FAILED)).

This is typically because the COM context 0x874478 where this RuntimeCallableWrapper was created has been disconnected
or it is busy doing something else.
Releasing the interfaces from the current COM context (COM context 0x874308).
This may cause corruption or data loss.
To avoid this problem, please ensure that all COM contexts/apartments/threads stay alive and are available for context transition,
until the application is completely done with the RuntimeCallableWrappers that represents COM components that live inside them.

Cheers
Knut

48
Of course :-)

Thanks, worked like a dream.

Note to future implementers of the same: Do NOT forget to call update on the element/folder that changes parent. It cost me a few hours of extra debugging ...

br
Knut

49
Guys,
I'm kind of stuck on a friday afternoon. Maybe that is why I am stuck :-)

Anyway, I want to move a package containing lots of subpackages and elements and stuff from package A to package B. Is there a way to that via the API? Or is it only the hard way?

br
Knut

50
Hi guys,

I am using 'App eaApp = (App)Microsoft.VisualBasic.Interaction.GetObject(null, "EA.App");' to get to a running EA.exe and it works fine. What I am wondering about is what happens if I have a number of EA instances running? I want to find out if a particular project is already running, not just any project.

Any suggestions?

thanks for any help
Knut

51
Hi guys,

I have a bit of trouble creating custom diagram type from my MDG.

I have created an MDG profile with language elements and diagram profiles. All this works very nice when I use it inside EA, but when I try to create one of my diagrams types via the API, I cannot figure out what to specify for the type parameter to the AddNew call.

I have tried every combination I can think of
  • Stereotype name

Metaclass name
alias
DiagramID
with or without my profile name in front
[/list]

the diagram ends up as a Class or Custom diagram, and consequently, the incorrect toolbox is displayed.

I have read the Scripting EA book, but his example only creates a class diagram, and if I try that it works well. So, only failing for my homegrown diagram types.

any ideas?

br
Knut

52
Hi guys,

I have a stand-alone windows program that opens a number of EA repositories in sequence searching for some stuff. If, for some reason, I supply invalid user name or password, EA pops up the login dialog asking for this information. Also, if the ODBC entry does not exist, EA pops up a dialog asking for a password.
Is there any way to avoid these dialogs? I would rather have an exception that I could handle and then move on to the next repository.

Thanks for any help :-)

53
Sorry for the noise guys :-)
The solution is of course just to use the Anchor property. The simple solution is often the best :-)

cheers
Knut

54
Automation Interface, Add-Ins and Tools / Resizing of Add-In window
« on: June 03, 2013, 08:52:04 pm »
Hi guys,

I have this control that I display in an Add-In window using Repository.AddWindow().  I would like the components inside my control  to re-size whenever the Add-In window is re-sized, but I am unable to find the size of the surrounding dockable window. Control's parent property is null. Any ideas?

cheers
Knut

55
The reason I came to think about this is that I often see locked diagrams in my model. It appears like EA not always will reset a lock when a user logs out. So, I was thinking that if the user holding the lock is still logged on I can call him, if not I can safely reset the lock.

Cheers
Knut

56
Thanks for replies :-)

We use MySql, but we all share a common DB user. Is it possible to find out how many times this user has connected?

So EA does not record the fact that a specific user logs on or off?

Cheers
Knut

57
Automation Interface, Add-Ins and Tools / Currently logged users
« on: May 31, 2013, 06:28:51 pm »
Hi guys,

Is there a way to find out exactly which users are logged on to a specific project right now?

Cheers
Knut

58
Hi guys,

I want to add a hyperlink element to my toolbox, but I cannot find a suitable base metaclass.

If the above problem is solvable, then I would like to decide that this link is to another diagram, have the diagram selection dialog open automatically and add a default text to the notes field. Possible?

Cheers
Knut

59
Hi guys,

I am trying to add a document element to my toolbox and I don't understand how to accomplish this. I am able to add an Artifact element, but then I need to create the linked document manually. Additionally, I would also like to decide the document template used for the linked document.

Any ideas?

Cheers
Knut

60
Hi guys,

I have added a control using the AddTab method. I would really like to know when the user decides to close this tab. Like if the user closes a diagram, the EA_OnPostCloseDiagram event is fired.

Any suggestions?

Cheers
Knut

Pages: 1 2 3 [4] 5 6