Windows Media Rights Manager SDK banner art

WMRMRights.ExpirationAfterFirstUse

The ExpirationAfterFirstUse property specifies and retrieves the license expiration in number of hours, beginning when the consumer first uses any of the rights specified in the license. For example, if a license allows playback, transferring to portable device, and copying (burning) to CD, any of these actions will begin the expiration countdown.

Syntax

WMRMRights.ExpirationAfterFirstUse = DWORD
DWORD = WMRMRights.ExpirationAfterFirstUse

Parameters

This property takes no parameters.

Return Values

When getting the value, this property returns a DWORD specifying the number of hours for which a license is valid, beginning when it is first used. If it fails, it returns E_FAIL.

Remarks

By default, this property is not set and the license does not expire.

Example Code

' Before you can issue a license, you must specify the consumer's
' rights and set them in the WMRMLicGen object.

' Declare objects.
    Dim sRights
    Dim RightsObj
    Dim LicGenObj

' Create objects.
    Set RightsObj = Server.CreateObject("Wmrmobjs.WMRMRights")
    Set LicGenObj = Server.CreateObject("Wmrmobjs.WMRMLicGen")

' Reset the WMRMRights object.
    RightsObj.Reset()

' Specify the rights that will be granted to the consumer.
    RightsObj.AllowBackupRestore = False
    RightsObj.AllowPlay = True

' Set the license to expire two days after the consumer opens the file.
    RightsObj.ExpirationAfterFirstUse = 48
    RightsObj.DisableOnClockRollback = True

' Retrieve the string containing the rights.
    sRights = RightsObj.GetAllRights()

' Set the rights in the license generator.
    LicGenObj.Rights = sRights

' Continue the license issuing process.

Requirements

Version: Windows Media Rights Manager 7 SDK or later

Reference: wmrmobjs 1.0 Type Library

Library: wmrmobjs.dll

Platform: Windows Server 2003

See Also