Sparx Systems Forum
Enterprise Architect => General Board => Topic started by: Darren Lock on August 29, 2002, 09:33:45 am
-
How do you create the Interop assembly required to use the EA Automation interface from VB.NET?
Dim x as object
x = CreateObject("EA.Repository") results in 'ActiveX error cannot create object" ???
The same code from VBScript workds OK.
-
Darren,
The following is working for me:
Public Class EADump
Public m_Repository As Object
Private m_rtf As New RTF()
' Run the main report
Public Sub Run(ByVal sInFilename As String, ByVal sOutFilename As String)
Try
' create object
m_Repository = CreateObject("EA.Repository")
m_Repository.openfile(sInFilename)
' open output file
m_rtf.OpenFile(sOutFilename)
' Dump - this is the report
DumpModel()
' Close things
m_rtf.CloseFile()
' close repository
m_Repository.exit()
m_Repository = Nothing
Catch e As Exception
m_rtf.WriteParagraph(e.Message)
End Try
End Sub
....
-
I now realise that the problem is security related as I am invoking the code from ASP.net!
Rgds, Darren.
-
As a newbie to OOPs, EA, and VB6:
Where do I get the class def for the REPOSITORY?
-
SonnyBoyIII,
the interface is IDispatch, that is, it is late bound. Therefore you can not reference it in vb6. Because it is late bound you will not be able to type the objects or perform compile time checking. All objects are of type object i.e.
dim objEA as object
set objeEA = CreateObject("EA.Repository")
Hope this helps ~8)~
-
Geoff,
would it be possible to extend Project_Interface.PutDiagramImageToFile to support GIF format?
Rgds, Darren