Quantcast
Channel: Darkroastjava's Public Notebook » Development
Viewing all articles
Browse latest Browse all 6

Enterprise Architect: Beware of for-each loops!

$
0
0
While developing a C#-based add-in for Sparx Enterprise Architect, I just encountered a very nasty bug: System.AccessViolationException: Attempted to read or write protected memory. And this is the "evil" code: foreach (EA.Element element in package.Elements). After some googling I found that the translation of "foreach" to a COM operation fails in that specific case. Use the following workaround to get rid of the issue...

Viewing all articles
Browse latest Browse all 6

Trending Articles