Xceed Zip Compression Library Documentation
License method (Xceed Zip control)
Xceed Zip control reference > Xceed Zip control methods > License method (Xceed Zip control)

The License method must be called to license the library for runtime use. This applies to both registered users as well as users of a time-limited free trial license.

If you do not call this method, Xceed Zip or Xceed Compression method calls will not work and will immediately return the xerNotLicensed or xceNotLicensed error code. 

Version 6.0 of Xceed Zip Compression Library introduces AES encryption support. Because of export restrictions in some countries, a new license validation had to be implemented. License keys that begin with "ZIP" enable AES encryption support while "ZIL" license keys, either trial or registered, do not activate AES encryption support.

When zipping in trial mode with a "ZIP" (ZIP60 or more recent) license key, if the EncryptionMethod property is set to xemWinZipAES, the EncryptionPassword property will be changed to "This is a trial password" only if it had been modified prior to setting the EncryptionMethod property. If a password other than "This is a trial password" is specified in the EncryptionPassword property after the EncryptionMethod property has been set, a "Set not permitted" error will be thrown. The password can also be specified via the ZipPreprocessingFile event however if a password other than "This is a trial password" is specified, the SkippingFile event will be raised with a xsrNotLicenced skipping reason.

When unzipping an AES-encrypted zip file in trial mode with a "ZIP" license key, the only password that can be used is "This is a trial password" and it must be specified via the EncryptionPassword property, InvalidPassword event, or UnzipPreprocessingFile event. If a password other than "This is a trial password" is specified, the SkippingFile event will be raised with a xsrNotLicenced skipping reason. When unzipping, the EncryptionMethod property does not need to be set.

For both registered and trial "ZIP" and "ZIL" license keys, if the EncryptionPassword property is an empty string, the files will not be encrypted regardless of the value of the EncryptionMethod.

Licensing for Xceed Zip for x64 and Xceed Zip for IA-64 (Itanium)

You need to purchase a license key in order to use Xceed Zip for x64 or Xceed Zip for IA-64; using a current "ZIP" license key will not work.

Time-limited free trial licenses for Xceed Zip for x64, without AES encryption, is available and works the same way as the 32-bit version. A trial license for Xceed Zip for IA-64 can be obtained by contacting Xceed Sales directly.

When to call the License method

The License method must be the first method you call after instantiating the component and/or before any other methods are called. For example:

Visual Basic Copy Code

Dim WithEvents m_xZip As XceedZip
Dim bReturn As Boolean

Set m_xZip = new XceedZip

bReturn = m_xZip.License( "SAMPLE-APPLICATION-KEY" )

If ( bReturn = False ) Then
    Call MsgBox( "Xceed Zip is not licensed for distribution!!" )
End If

Parameters

Parameter Description
sLicense  Provide your license key here. Both registered users and trial version users have a license key. This key can be found by selecting the Start -> Programs -> Xceed Components -> Xceed Component Licenser menu item. Trial version keys are time-limited and will not work after the trial period has ended.

Return values

Returns True if the license key was accepted; False if the license key was invalid.

Remarks

The License method is required because instantiation methods such as CreateObject() and CoCreateInstance() do not cooperate with the licensing scheme provided by IClassFactory2.

VC++ Copy Code

DXceedZip and DXceedCompression
HRESULT License( [in] BSTR sLicense, [out,retval] VARIANT_BOOL* pbSucceeded )