The information provided by this directive is used by Microsoft® Visual J++® (specifically, the vjreg tool) to register the compiled Java class as a COM object in the system registry. It contains all the information necessary to make these registry entries. The Microsoft VM does not use any of the class attributes at runtime.
An @com.register directive must be specified if an @com.transaction or @com.typeinfo directive is present.
@com.register(clsid=GUID, [typelib=GUID], [version=string], [description=string], [progid=string])
clsid=GUID | The CLSID for the COM object that this class represents. |
typelib=GUID | The GUID of the type library for this Java-implemented COM object. |
version=string
Example: version="3.2" |
The version of the Java-implemented object, in the form "<major version>, <minor version>", where both <major version> and <minor version> are 16-bit integers. |
description=string | Some descriptive text about the COM object. |
progid=string | This string will be registered in the ProgID section of the registry for creation of this COM object with the specified friendly name. |
COM_Register | Class scope. |
The following example shows some simple registration information for a Java/COM object with the given CLSID and type library GUID.
/** @com.register(clsid=8856F961-340A-11D0-A96B-00C04FD705A2, typelib=EAB22AC0-30C1-11CF-A7EB-0000C05BAE0B, version="1.1", description="WebBrowser Control", progid="Shell.Explorer.2")*/ public class WebBrowser implements com.ms.com.IUnknown { }