IWMEncProfile2::RemoveLanguage

Windows Media Encoder SDK banner art

The RemoveLanguage method removes a language from the profile.

Syntax

HRESULT RemoveLanguage(
  WMENC_SOURCE_TYPE  enumSrcType,
  short  iRenderSite,
  long  lcidLanguage
);

Parameters

enumSrcType

[in]  Specifies a member of the WMENC_SOURCE_TYPE enumeration type.

iRenderSite

[in]  short containing the audience stream index. Because an audience can contain only one stream of each type, iRenderSiteIndex must be 0.

lcidLanguage

[in]  long specifying the locale ID, which is a 32-bit value that consists of a language ID, sort ID, and reserved bits that identify a particular language. For example, the LCID for English is 1033, and the LCID for Japanese is 1041.

Return Values

If the method succeeds, it returns S_OK. If it fails, it supports the IErrorInfo interface and returns an HRESULT error code.

Example Code

// Include libraries.
#include <windows.h>
#include <atlbase.h>
#include <comdef.h>
#include "C:\WMSDK\WMEncSDK9\include\wmencode.h"

    // Declare variables.
    HRESULT hr;
    IWMEncoder* pEncoder;
    IWMEncProfileCollection* pProColl;
    IWMEncProfile* pPro;

    IWMEncProfile2* pPro2;

    // Initialize the COM library and retrieve a pointer to an IWMEncoder interface.
    hr = CoInitialize(NULL);
    if ( SUCCEEDED( hr ) )
    {
        hr = CoCreateInstance(CLSID_WMEncoder,
            NULL,
            CLSCTX_INPROC_SERVER,
            IID_IWMEncoder,
            (void**) &pEncoder);
    }

    // Retrieve a specific profile.
    if ( SUCCEEDED( hr ) )
    {
        hr = pEncoder->get_ProfileCollection(&pProColl);
    }
    if ( SUCCEEDED( hr ) )
    {
        hr = pProColl->Item(11, &pPro);
    }

    if ( SUCCEEDED( hr ) )
    {
        hr = CoCreateInstance(CLSID_WMEncProfile2,
            NULL,
            CLSCTX_INPROC_SERVER,
            IID_IWMEncProfile2,
            (void**) &pPro2);
    }

    if ( SUCCEEDED( hr ) )
    {
        hr = pPro2->LoadFromIWMProfile(pPro);
    }

    // Remove English from the profile.
    if ( SUCCEEDED( hr ) )
    {
        hr = pPro2->RemoveLanguage(WMENC_AUDIO, 0, 1033);
    }

    // Release pointers.
    if ( pPro2 )
    {
        pPro2->Release();
        pPro2 = NULL;
    }

Requirements

Header: wmencode.h

Library: wmenc.exe

See Also