The Microsoft Java compiler directives are optional special comments inserted in source code to aid in Java/COM integration and development. This reference describes their syntax and parameters, lists their related attributes and directives, and gives usage examples.
Directive parameters are optional unless otherwise specified. Those parameters that are valid only in conjunction with others, or have other dependencies, are marked as such.
The parameters and their values are case-sensitive. Each directive exists as part of a special comment block. Therefore, it must be preceded by a forward slash and two asterisks (/**) and closed with a forward slash (/). Directives in comment blocks beginning with a forward slash and only one asterisk (/*) are not recognized by the compiler.
Note The com.ms.com.NoAutoScripting and com.ms.com.NoAutoMarshaling interfaces assert behavior on Java/COM objects that complements the directives' functionality.
The Microsoft Java compiler directives are as follows:
@com.class specifies that this Java object represents a COM coclass with the given GUID, casting support, and Java security requirements.
@com.interface indicates that this Java interface represents a COM interface with the specified GUID, threading model, and types.
@com.method marks the Java method as a COM interface method, which should be exposed in the object's vtable, dispatch table, or neither.
@com.parameters specifies which parameters are in, out, or a return value and how they should be mapped to COM and from COM to Java.
@com.register used by the Microsoft® Visual J++® vjreg tool to register the compiled Java class as a COM object in the system registry.
@com.struct (see @dll.struct) specifies that the Java class will be a Java-Callable Data Wrapper (JCDW).
@com.structmap (see @dll.structmap) indicates how a JCDW field should map to COM and from COM back to this field in Java.
@com.transaction indicates various transaction situations in which the Microsoft Transaction Server can host COM objects.
@com.typeinfo specifies that additional information from the type library represents this COM object.
@dll.import maps a C function from the specified DLL to a Java method.
@dll.struct specifies that the Java class will be a Java-Callable Data Wrapper (JCDW).
@dll.structmap indicates how a JCDW field should map to COM and from COM back to this field in Java.
@security modifies class link-time access check behavior and stack crawl behavior for J/Direct method calls.
Attributes Reference describes the special attributes generated by the compiler directives. These attributes support Java/COM integration and Java/Microsoft® Win32® integration.
Integrating Java and COM (programmer's guide)
Using COM Objects from Java (white paper)
Integrating Java and COM (white paper)
COM Samples
J/Direct Samples