Readme for Windows Media Player 10 SDK

January 2006

This documentation provides late-breaking or other information that supplements the documentation for the Microsoft® Windows Media® Player 10 Software Development Kit (SDK).

For up-to-date information about issues not described in this document, refer to the Windows Media Player 10 SDK on the Microsoft Web site.

Contents

Known issues

   Plug-in wizard requires modifications to work with Visual Studio 2005

   Player control can cause an exception with Visual Basic .NET 2002

   Naming conflicts are possible with Visual Studio .NET 2003

   Windows Media Player 6.4 compatibility issues

   Installing to a custom location can cause problems

   Sample video DSP plug-in might not work with Windows Media Player 10

Viewing the sample online stores

64-bit development not supported

Legal notice

Known issues

Plug-in wizard requires modifications to work with Visual Studio 2005

When you install the Windows Media Player 10 Software Development Kit (SDK), the SDK setup program tries to configure the Windows Media Player plug-in wizard to work with Microsoft Visual Studio®. Because the Player SDK was released before Visual Studio 2005, the setup program cannot configure the plug-in wizard for Visual Studio 2005, and the plug-in wizard does not work.

To resolve this problem, manually configure the plug-in wizard to work with Visual Studio 2005. To do this, follow these steps:

  1. Close any running instances of Visual Studio.
  2. Using Windows Explorer, locate the folder where you installed the Player SDK. Expand the folder to view its subfolders and locate the subfolder named \Wizards\VSNET. The default location is C:\WMSDK\WMPSDK10\Wizards\VSNET.
  3. Locate the following three files in that folder:
    • wmpwiz.ico
    • wmpwiz.vsdir
    • wmpwiz2003.vsz
  4. Select all three files. Right-click the files, and then click Copy.
  5. Where you installed Visual Studio 2005, locate the subfolder named \VC\vcprojects. (You can try to find this folder quickly by searching for files that have the .vsz file name extension.) Paste the three files that you copied from the VSNET folder into this folder.
  6. In the vcprojects folder, rename wmpwiz2003.vsz file to wmpwiz.vsz.
  7. Using Notepad, edit two lines of the file that you renamed wmpwiz.vsz:
    1. Replace the second line of the file with the following text:

      Wizard=VsWizard.VsWizardEngine.8.0
      
    2. Locate the following line:

      Param="ABSOLUTE_PATH = %s"
      

      Change the value for ABSOLUTE_PATH to point to the root folder where the wizard files are located. For example, if you installed the SDK at C:\WMSDK\WMPSDK10\, then change the text to read as follows:

      Param="ABSOLUTE_PATH = C:\WMSDK\WMPSDK10\Wizards\VSNET"
      
  8. Save and close the file.

The wizard is now installed. However, before you run the wizard, you must modify some script code. To make the modifications, follow these steps:

  1. In the location where you installed the Player SDK, locate the \scripts\1033 folder. The default location is C:\WMSDK\WMPSDK10\Wizards\VSNET\scripts\1033.

  2. In that folder, locate the file named default.js. Because you will be modifying the code in this file, it is a good idea first to make a copy to keep as a backup.

  3. Using Notepad, open default.js to edit it.

  4. Locate the function named OnFinish.

  5. In the OnFinish function, locate the following conditional code block:

    if (!bEmptyProject)
    {
        var InfFile = CreateInfFile();
        AddFilesToProject(selProj, strProjectName, InfFile);
        SetCommonPchSettings(selProj);
        InfFile.Delete();
        var projName = strProjectPath + "\\" + strProjectName + ".vcproj";
        selProj.Object.Save();
    }
    
  6. Delete the code in step 5 and replace it with the following code:

    if (!bEmptyProject)
    {
        if (bVS2003)
        {
            AddFilesToProjectWithInfFile(selProj, strProjectName);
            SetCommonPchSettings(selProj);
        }
        else
        {
            var InfFile = CreateInfFile();
            AddFilesToProject(selProj, strProjectName, InfFile);
            SetCommonPchSettings(selProj);
            InfFile.Delete();
        }
        var projName = strProjectPath + "\\" + strProjectName + ".vcproj";
        selProj.Object.Save();
    }
    
  7. Save the modified file, default.js.

The Windows Media Player plug-in wizard is now configured to work correctly with Visual Studio 2005.

Player control can cause an exception with Visual Basic .NET 2002

If you use Microsoft Visual Basic® .NET 2002 to create a project that embeds the Windows Media Player ActiveX® control, the project may raise an exception. To avoid this issue, you must first remove (or comment) the following line of code from the code that is generated automatically by Visual Basic .NET:

Me.AxWindowsMediaPlayer1.enabled = True

Naming conflicts are possible with Visual Studio .NET 2003

If you use Microsoft Visual Studio .NET 2003 to create a managed code project that embeds the Windows Media Player ActiveX control, some object, property, method, and event names may be different from those in the Windows Media Player SDK. When Visual Studio encounters a naming conflict in the wrapper class it creates for an ActiveX control, it prefixes the control object, property, method, or event name with the letters "Ctl". This identifies the name as being associated with the control.

For example, the Player.Controls property becomes the Ctlcontrols property in Visual Studio .NET 2003 when creating a C# solution.

Windows Media Player 6.4 compatibility issues

You may experience changes in the behavior of the Windows Media Player 6.4 ActiveX control after installing Windows Media Player 10. For more information about compatibility, see the Windows Media Player 6.4 SDK on the Microsoft Web site.

Installing to a custom location can cause problems

If you install the Windows Media Player 10 SDK to a location other than the default, problems may arise when subsequently installing other Windows Media SDKs. To avoid problems, use the default install location.

Sample video DSP plug-in might not work with Windows Media Player 10

If you use the Windows Media Player Plug-in Wizard to create the sample video DSP plug-in, and then use the plug-in with Windows Media Player 10, the plug-in might not process the video. This problem occurs because of an issue in the sample code. To correct this issue, you can modify the sample code created by the wizard.

Follow these steps to modify the sample code:

  1. In Visual Studio or a text editor, open the .cpp file having the same name as your project. For example, if you named your plug-in project MyDSP, open the file named MyDSP.cpp.

  2. Locate the implementation for the ValidateMediaType function.

  3. Select the following code and cut it to move it to the clipboard.

    BITMAPINFOHEADER bmiHeaderTarget;
    RECT rcTarget = { 0 };
    
    if( SUCCEEDED( hr ) )
    {
        hr = GetBitmapInfoHeader( pmtTarget, &bmiHeaderTarget );
    }
    
  4. Paste the code from step 3 just before the following code:

    // Make sure the subtype is a supported format.
    while( cSubTypes-- )
    {
    ...
    
  5. Replace the entire while loop mentioned in step 4 with the following code:

    if(SUCCEEDED(hr))
    {
        // Make sure the subtype is a supported format.
        while( cSubTypes-- )
        {
            if( *k_guidValidSubtypes[cSubTypes] == pmtTarget->subtype  )
            {
                if( MEDIASUBTYPE_YV12 == pmtTarget->subtype )
                {                  
                    if( bmiHeaderTarget.biBitCount != 12 )
                    {
                        bValid = false;
                        break;
                    }                    
                }
    
                bValid = true;
                break;
            }
        }
    }
    
  6. Save the .cpp file and recompile your project.

Viewing the sample online stores

You can view sample music and commerce online stores by setting the following registry value:

[HKEY_CURRENT_USER\Software\Microsoft\MediaPlayer\Services]

"TestParameter"="8540;8541"

When you set this value and open Windows Media Player 10, the online stores list will include the MSSampleMusic and MSSampleCommerce stores. These stores demonstrate basic implementations for a music store and a commerce store. You can view the source code of each host Web page by clicking the View Source links.

64-bit development not supported

The Windows Media Player SDK supports 32-bit development only. 64-bit development is not supported.

Information in this document, including URL and other Internet Web site references, is subject to change without notice.  Unless otherwise noted, the example companies, organizations, products, domain names, e-mail addresses, logos, people, places and events depicted herein are fictitious, and no association with any real company, organization, product, domain name, e-mail address, logo, person, places or events is intended or should be inferred.  Complying with all applicable copyright laws is the responsibility of the user.  Without limiting the rights under copyright, no part of this document may be reproduced, stored in or introduced into a retrieval system, or transmitted in any form or by any means (electronic, mechanical, photocopying, recording, or otherwise), or for any purpose, without the express written permission of Microsoft Corporation.

Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual property rights covering subject matter in this document.  Except as expressly provided in any written license agreement from Microsoft, the furnishing of this document does not give you any license to these patents, trademarks, copyrights, or other intellectual property.

© 2006 Microsoft Corporation. All rights reserved.

Microsoft, MS-DOS, Windows, Windows Media, Windows NT, Windows Server, Windows Vista, Active Directory, ActiveSync, ActiveX, Direct3D, DirectDraw, DirectInput, DirectMusic, DirectPlay, DirectShow, DirectSound, DirectX, FrontPage, HighMAT, JScript, Microsoft Press, MSN, NetShow, Outlook, PowerPoint, Visual Basic, Visual C++, Visual InterDev, Visual J++, Visual Studio, WebTV, Win32, and Win32s are either registered trademarks or trademarks of Microsoft Corporation in the U.S.A. and/or other countries.

The names of actual companies and products mentioned herein may be the trademarks of their respective owners.

This software is based in part on the work of the Independent JPEG Group.

GIF decompression code, copyright 1990, David Koblas. Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. This software is provided "as is" without express or implied warranty.