Book a Demo

Please note : This help page is not for the latest version of Enterprise Architect. The latest help can be found here.

Prev Next

MDG_Connect

An Add-In uses MDG_Connect to handle a user driven request to connect a model branch to an external application. The function is called when the user attempts to connect a particular Enterprise Architect Package to an as yet unspecified external project. The Add-In calls the event to interact with the user to specify such a project.

The Add-In is responsible for retaining the connection details, which should be stored on a per-user or per-workstation basis. That is, users who share a common Enterprise Architect model over a network should be able to connect and disconnect to external projects independently of one another.

The Add-In should therefore not store connection details in an Enterprise Architect repository. A suitable place to store such details would be:

     SHGetFolderPath(..CSIDL_APPDATA..)\AddinName

The PackageGuid parameter is the same identifier as is required for most events relating to the MDG Add-In. Therefore it is recommended that the connection details be indexed using the PackageGuid value.

The PackageID parameter is provided to aid fast retrieval of Package details from Enterprise Architect, should this be required.

Syntax

Function MDG_Connect (Repository As EA.Repository, PackageID as Long, PackageGuid As String) As Long

The MDG_Connect function syntax contains these parameters.

Parameter

Type

See also

Repository

EA.Repository

Direction: IN

Description: An EA.Repository object representing the currently open Enterprise Architect model. Poll its members to retrieve model data and user interface status information.

Repository Class

PackageID

Long

Direction: IN

Description: The PackageID of the Enterprise Architect Package the user has requested to have connected to an external project.

PackageGuid

String

Direction: IN

Description: The unique ID identifying the project provided by the Add-In when a connection to a project branch of an Enterprise Architect model was first established.

Return Value

  • Return a non-zero to indicate that a connection has been made
  • Return a zero to indicate that the user has not nominated a project and connection should not proceed

Learn more