Share via


FDRM Sample

Send Feedback

The Windows Mobile Version 5.0 Pocket PC and Smartphone Software Developer's Kit (SDK) ships with a code sample application named FileDRM that demonstrates how to use the FDRM API, which allow applications to use Digital Rights Management (DRM) protected content. The application displays DRM protected JPEG images.

The code sample demonstrates the standard method for using FDRM content, which involves:

  1. Initially verifying that you will be able to use the content before attempting to open it. The routine CimageView::OpenImageFile demonstrates this step using FileDrmVerifyRights.
  2. Using the FDRM method of opening the file. The routine CimageView::OpenImageFile demonstrates this step using FileDrmCreateFile. This method is used instead of the Win32 CreateFile function.
  3. Specify the right used for the content. The routine CimageView::Draw demonstrates this step using FileDrmCommitRights. For this application, rights to this content are based on the number of times that the content can be used. For this reason, this API is not invoked until after the content opens successfully.

The code sample demonstrates the use of the FileDrmGetMetric function to determine how frequently rights to the protected image need to be re-verified. In addition, it shows how to use the FileDrmIsDRM and FileDrmShowLicenseInfo functions to show the protection status for the JPEG image.

Software Requirements

You must have an FDRM engine installed on your Windows Mobile 5.0 Pocket PC or Smartphone.

For your development environment, you must use Visual Studio 2005 or later.

Sample Location

To run the code sample, you must install either the Windows Mobile 5 Pocket PC or Smartphone SDKs. If you install either one to the default location, the solution files are copied to the following folders:

C:\Program Files\Windows CE Tools\wce500\Windows Mobile 5.0 Pocket PC SDK\Samples\CPP\Win32\Filedrm\FileDRM.sln
C:\Program Files\Windows CE Tools\wce500\Windows Mobile 5.0 Smartphone SDK\Samples\CPP\Win32\Filedrm\FileDRM.sln

Note This sample application is not intended for production use.

See Also

FDRM Application Development

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.