Packages
 In this topic

*Methods

 

Packages   PreviousThis PackageNext
Package com.ms.com   Previous This
Package
Next

 


Class LicenseMgr

public final class LicenseMgr implements IUnknown,ILicenseMgr
{
  // Methods
  public native IUnknown createFromPackage(int index,
        IUnknown punkOuter, int ctxFlags);
  public native IUnknown createInstance(String clsid,
        IUnknown punkOuter, int ctxFlags);
  public native IUnknown createWithLic(String lic, String clsid,
        IUnknown punkOuter, int ctxFlags);
  public native void setPackage(String url);
}

This class works with the ILicenseMgr interface to enable you to use licensed Component Object Model (COM) components or controls in your Java application.

In the LicenseMgr class, methods are not called directly. Instead, you create an instance of LicenseMgr and use the ILicenseMgr interface to manipulate the instance, as in the following example:

ILicenseMgr licmgr = (ILicenseMgr)new LicenseMgr();
   // use licmgr interface

For more information on how to use licensed COM components, see the ILicenseMgr interface.

Methods

createFromPackage

public native IUnknown createFromPackage(int index, IUnknown punkOuter, int
        ctxFlags);

Creates a package. This method cannot be invoked directly. You must first cast the LicenseMgr object to the ILicenseMgr interface and invoke the method through the interface.

Return Value:

Returns the newly created package.

ParameterDescription
index The index of the package.
punkOuter The aggregating object if the object is created as part of an aggregate; otherwise, the value is null.
ctxFlags The ComContext value that represents the context that the new object should be created in.

createInstance

public native IUnknown createInstance(String clsid, IUnknown punkOuter, int
        ctxFlags);

Creates an instance of a specific COM class. This method cannot be invoked directly. You must first cast the LicenseMgr object to the ILicenseMgr interface and invoke the method through the interface.

Warning In general, this method should not be called. The best way to create an instance of a COM class is to use the new operator on the Java wrapper generated by the jactivex tool.

Return Value:

Returns an instance of the specified COM class.

ParameterDescription
clsid The class identifier (CLSID) of the instantiated COM class.
punkOuter The aggregating object if the object is being created as part of an aggregate; otherwise, the value is null.
ctxFlags The ComContext value that represents the context that the new object is created in.

Exceptions:

com.ms.com.ComFailException if an error occurs while instantiating the class.

createWithLic

public native IUnknown createWithLic(String lic, String clsid,
        IUnknown punkOuter, int ctxFlags);

Creates an instance of a licensed control. This method cannot be invoked directly. You must first cast the LicenseMgr object to the ILicenseMgr interface and invoke the method through the interface.

Return Value:

Returns a new instance of the specified licensed COM class.

ParameterDescription
lic The license for the instantiated COM class.
clsid The class identifier (CLSID) of the instantiated COM class.
punkOuter The aggregating object if the object is being created as part of an aggregate; otherwise, the value is null.
ctxFlags The ComContext value that represents the context that the new object is created in.

Exceptions:

com.ms.com.ComFailException if an error occurs while instantiating the class.

setPackage

public native void setPackage(String url);

Sets the package for a specific URL. This method cannot be invoked directly. You must first cast the LicenseMgr object to the ILicenseMgr interface and invoke the method through the interface.

Return Value:

No return value.

ParameterDescription
url The Uniform Resource Locator (URL) of the package.

upnrm.gif © 1998 Microsoft Corporation. All rights reserved. Terms of use.