Prev | Next |
Tips and Tricks
Considerations
Item |
Detail |
See also |
---|---|---|
GUID |
The registration GUID and name used to register an Add-In should be the same for Enterprise Architect 32 bit and 64 bit versions. Only the name and/or location of the DLL should be different. |
|
Enterprise Architect 64 bit and C++ Add-Ins |
Apart from using the correct registration key (see step 4 in the Deploy Ad-Ins Help topic) there is no special configuration for getting a 64 bit COM object running under Enterprise Architect 64 bit. |
Deploy Add-Ins |
.NET Add-Ins |
When generating a .NET assembly, you must explicitly set the 'Target Platform' to x86/x64. Leaving it on 'Any CPU' could cause issues when Enterprise Architect 32 bit is run on a 64 bit version of windows. Add a x64 Target to your project and rebuild the project. Visual Studio has an issue when attempting to register a .NET assembly when the Interop.EA is included in a project. It will attempt to use regasm for the architecture Interop.EA was built for. We have found adding to the Post-Build Script helps, if you uncheck the 'Register for COM interop' option in the project settings (assuming you have permission to write to the registry). if $(PlatformName) == x64 ( "%Windir%\Microsoft.NET\Framework64\v4.0.30319\regasm" "$(TargetPath)") if $(PlatformName) == x86 ( "%Windir%\Microsoft.NET\Framework64\v4.0.30319\regasm" "$(TargetPath)") Note: At the time of writing, .NET Add-ins will not work under Wine and using Wine-Mono. |
|
Java API |
The Java API loads the last installed Enterprise Architect and isn't affected when using either the 32 or 64 version of the dll, as long as the SSJavaCOM DLL can be found by the Java runtime. |
|
Visual Basic 5/6 Users Note |
Visual Basic users should note that the version number of the Enterprise Architect interface is stored in the VBP project file in a form similar to this: Reference=*\G{64FB2BF4-9EFA-11D2-8307-C45586000000}#2.2#0#..\..\..\..\Program Files\Sparx Systems\EA\EA.TLB#Enterprise Architect Object Model 2.02 If you experience problems moving from one version of Enterprise Architect to another, open the VBP file in a text editor and remove this line. Then open the project in Visual Basic and use Project-References to create a new reference to the Enterprise Architect Object model. |
|
Holding State Information |
It is possible for an Add-In to hold state information, meaning that data can be stored in member variables in response to one event and retrieved in another. There are some dangers in doing this:
It is recommended that unless there is a specific reason for doing so, the Add-In should use the repository parameter and its method and properties to provide the necessary data. |
|
Enterprise Architect Not Closing |
.NET Specific Issues Automation checks the use of objects and will not allow any of them to be destroyed until they are no longer being used. As noted in the Automation Interface topic, if your automation controller was written using the .NET framework, Enterprise Architect does not close even after you release all your references to it. To force the release of the COM pointers, call the memory management functions as shown: GC.Collect(); GC.WaitForPendingFinalizers(); Additionally, because automation clients hook into Enterprise Architect, which creates Add-Ins that in turn hook back into Enterprise Architect, it is possible to get into a deadlock situation where Enterprise Architect and the Add-Ins will not let go of one another and keep each other active. An Add-In might retain hooks into Enterprise Architect because:
There are two actions required to avoid deadlock situations:
It is possible that your Automation client controls a running instance of Enterprise Architect where the Add-Ins have not complied with the rules. In this case you could call Repository.Exit() to terminate Enterprise Architect. Miscellaneous In developing Add-Ins using the .NET framework you must select COM Interoperability in the project's properties in order for it to be recognized as an Add-In. Some development environments do not automatically register COM DLLs on creation. You might have to do that manually before Enterprise Architect recognizes the Add-In. You can use your private Add-In key (as required for Add-In deployment) to store configuration information pertinent to your Add-In. |
Examples and Tips Tips and Tricks Add-In Events |