Microsoft SDK for Java

@com.class

The @com.class directive is applied at the class level to indicate that the Java class definition represents a COM component object class (coclass).  

Syntax

@com.class(classid=GUID, iid=GUID, DynamicCasts, safe, safeAddFlags=integer)

Parameters

classid=GUID

This parameter is required.

Example: classid=0BE35203-8F91-11CE-9DE3-00AA004BB851

Represents the class identifier (CLSID) associated with this Java-implemented COM object.
iid=GUID Represents the interface identifier (IID) for this interface.
DynamicCasts Indicates that this class supports dynamic casts, which allow the user to cast instances of this class to COM interfaces not directly implemented by the class. The Microsoft virtual machine determines that the Java object supports the interface by requesting it in a call to QueryInterface on the Java object's underlying COM object.
safe Specifies that the structure may be used safely by untrusted classes. A COM_Safety attribute is attached to the class.
safeAddFlags=integer Specifies a word of information to be put in the COM_Safety attribute.

Note   The Microsoft VM currently ignores this data when reading the COM_Safety attribute.


Attributes

COM_Class_Type Class scope.
COM_GuidPool Class scope.
COM_Safety Class scope.

Related Directives

@com.interface

@com.register

@com.typeinfo

@com.transaction

Example

The following declaration indicates that the defined class represents a COM object with the given CLSID that supports dynamic casts.

/** 
* @com.class(classid=D7D6E07A-DCCD-11D0-AA4B-60970DEBAE, DynamicCasts)
*/
public class MyObject implements com.ms.com.IUnknown { }

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