Creating Profiles

[The feature associated with this page, Windows Media Format 11 SDK, is a legacy feature. It has been superseded by Source Reader and Sink Writer. Source Reader and Sink Writer have been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use Source Reader and Sink Writer instead of Windows Media Format 11 SDK, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]

In many cases, you will want to create an empty profile to configure for your needs. In other cases it is easier to edit an existing profile, like a system profile. For more information about using system profiles, see Using System Profiles.

Creating an empty profile, ready for you to configure, requires a profile manager object. To get the IWMProfileManager interface of a profile manager object, call the WMCreateProfileManager function.

To create an empty profile, call IWMProfileManager::CreateEmptyProfile. When you create an empty profile, the only thing you specify is the version of the Windows Media Format SDK with which the profile complies. Unless you have a specific need to use a previous version, you should always use the latest version. The version dictates the structure of the profile; previous versions did not support some properties.

The following example code shows how to create a new profile. To compile this code in your application, include stdio.h. For more information about using this code, see Using the Code Examples.

HRESULT CreateProfile(IWMProfileManager* pProfileMgr, IWMProfile** ppProfile)
{
    HRESULT hr = S_OK;

    // Create the empty profile.
    hr = pProfileMgr->CreateEmptyProfile(WMT_VER_9_0, ppProfile);
    if(FAILED(hr))
    {
        printf("Could not create the profile.\n");
        return hr;
    }

    return S_OK;
}

IWMProfile Interface

IWMProfileManager Interface

Working with Profiles