The Application interface is the interface to a MapForce application object. It represents the main access point for the MapForce application itself. This interface is the starting point to do any further operations with MapForce or to retrieve or create other MapForce related automation objects. For information about creating an instance the Application object, see Accessing the API.
Properties to navigate the object model:
MapForce code generation:
Returns the automation object of the currently active document. This property returns the same as Documents.ActiveDocument.
Returns the automation object of the currently active project.
Retrieves the application's top-level object.
Returns a collection of all currently open documents.
Returns the edition of the application, e.g. "Altova MapForce Enterprise Edition" for the enterprise edition.
Gets or sets the name of the active global resource configuration file. By default, the file is called GlobalResources.xml.
The configuration file can be renamed and saved to any location. You can therefore have multiple Global Resources XML files. However, only one of these Global Resources XML File can be active, per application, at one time, and only the definitions contained in this file will be available to the application.
Gets or sets the global resource definition file. By default, the file is called GlobalResources.xml.
Returns true if the API is supported in this version of MapForce.
Gets a collection of imported libraries. In the MapForce graphical user interface, these correspond to entries from the Manage Libraries window, added at application level.
Gets the major version number of MapForce. The version is calculated starting from 1998, and is incremented by one every year. For example, the major version is "18" for the release 2016.
The minor version number of the product, e.g. 2 for 2006 R2 SP1.
The name of the application.
This property gives access to options that configure the generation of code.
The parent object according to the object model.
The service pack version number of the product, e.g. 1 for 2016 R2 SP1.
The status of the application. It is one of the values of the ENUMApplicationStatus enumeration.
True if MapForce is displayed on the screen (though it might be covered by other applications or be iconized).
False if MapForce is hidden. The default value for MapForce when automatically started due to a request from the automation server Application is false. In all other cases, the property is initialized to true.
An application instance that is visible is said to be controlled by the user (and possibly by clients connected via the automation interface). It will only shut down due to an explicit user request. To shut down an application instance, set its visibility to false and clear all references to this instance within your program. The application instance will shut down automatically when no further COM clients are holding references to it.
Retrieves the application's Window Handle.
Use this method to highlight a location in a mapping file that has been previously serialized. If the corresponding document has not already been loaded, it will be loaded first. See Document.GenerateCodeEx for a method to retrieve a serialized marker.
Creates a new empty document. The newly opened document becomes the ActiveDocument. This method is a shortened form of Documents.NewDocument.
Creates a new empty project. The current project is closed. The new project is accessible under ActiveProject.
Creates a new empty Web Service project. The new project is accessible under ActiveProject. This method is available in MapForce Enterprise Edition only.
Loads a previously saved document file and continues working on it. The newly opened document becomes the ActiveDocument. This method is a shorter form of Documents.OpenDocument.
Opens an existing Mapforce project (*.mfp). The current project is closed. The newly opened project is accessible under ActiveProject.
Loads a previously saved document file from an URL location. Allows user name and password to be supplied.
Disconnects from MapForce to allow the application to shutdown. Calling this method is optional since MapForce keeps track of all external COM connections and automatically recognizes a disconnection. For more information on automatic shutdown see the Visible property.
This event is triggered when an existing or new document is opened. The corresponding close event is Document.OnDocumentClosed.
This event is triggered when an existing or new project is loaded into the application. The corresponding close event is Project.OnProjectClosed.
This event is triggered when the application is shutting down.