Microsoft SDK for Java

@com.interface

The @com.interface directive marks the current Java interface as a COM interface.

Syntax

@com.interface(iid=GUID, [thread=AUTO | NO, type=DISPATCH | DUAL | VTABLE])

Parameters

iid=GUID

This parameter is required.

Represents the interface identifier (IID) for this interface.
thread=AUTO | NO Specifies the default Microsoft VM marshaling behavior to be applied to any COM object parameters (type=DISPATCH or type=OBJECT in the @com.parameters directive) in this interface's methods. If AUTO is specified, the Microsoft VM automatically marshals any calls from Java on these objects to the thread that the object was created in, which is the thread that originally received the object. This is the safest option, and the default.

If NO is specified, the Microsoft VM assumes that the object is callable on any Java thread.

Default: AUTO

type=DISPATCH | DUAL | VTABLE DISPATCH indicates that this interface can be used only as a dispatch interface.

DUAL indicates that this interface is a dual interface, accessible as both a dispatch interface and a vtable interface.

VTABLE indicates that this interface can be used only as a vtable interface.

Default: VTABLE.


Attributes (indirect)

COM_ExposedAs_Group Method scope.
COM_GuidPool Class scope.
COM_MethodPool Class scope.
COM_ProxiesTo Method scope.

Related Directives

@com.class

@com.register

@com.typeinfo

@com.transaction

Examples

The following @com.interface directive describes a custom interface with the given IID. All COM object parameters in the methods of this interface are assumed to be apartment-neutral because the thread=NO directive parameter is specified.

/** 
*@com.interface(iid=B643D339-2CAB-11D2-94EB-00C04FB92EC2, thread=NO)   
*/
public interface IPing extends com.ms.com.IUnknown { }

A dual interface can be described with:

/** @com.interface(iid=D30C1661-CDAF-11D0-8A3E-00C04FC9E26E, thread=AUTO, type=DUAL) */
public interface IWebBrowser2 extends com.ms.com.IUnknown { }

See Also

iid_is and size_is Support
%SDKDIR%\Samples\com\iid_is_size_is

© 1999 Microsoft Corporation. All rights reserved. Terms of use.