MapForce API

Programming Languages

Home Prev Top Next

This section provides language-specific examples of using the MapForce COM API. Programming languages differ in the way they support COM access. A few examples for the most frequently used languages (links below) will help you get started.

 

C# Project

Java Project

JScript

 

Important points

In .NET, for every interface of the MapForce COM automation interface, a .NET class exists with the same name. Also, COM types will be converted to the appropriate .NET type. For example, a type such as Long in the COM API would appear as System.Int32 in .NET.

 

In Java, note the following syntax variations:

 

Classes and class names. For every interface of the MapForce automation interface, a Java class exists with the name of the interface.

Method names. Method names on the Java interface are the same as used on the COM interfaces, but start with a small letter to conform to Java naming conventions. To access COM properties, Java methods that prefix the property name with get and set can be used. If a property does not support write-access, no setter method is available. For example, for the Name property of the Document interface, the Java methods getName and setName are available.

Enumerations. For every enumeration defined in the automation interface, a Java enumeration is defined with the same name and values.

Events and event handlers. For every interface in the automation interface that supports events, a Java interface with the same name plus 'Event' is available. To simplify the overloading of single events, a Java class with default implementations for all events is provided. The name of this Java class is the name of the event interface plus 'DefaultHandler'. For example:

 

Application // Java class to access the application

ApplicationEvents // Events interface for the application

ApplicationEventsDefaultHandler // Default handler for "ApplicationEvents"

 

© 2019-2025 Altova GmbH