Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

This function registers a mapping of media types to CLSIDs to override the default mapping specified in the registry.

Syntax

HRESULT RegisterMediaTypeClass(
  LPBC 
pbc,
  UINT 
ctypes,
  LPCSTR* 
rgszTypes,
  CLSID* 
rgclsID,
  DWORD 
dwReserved
);

Parameters

pbc

[in] Address of the IBindCtxinterface for the bind context in which the media types are to be registered.

ctypes

[in] Unsigned integer value that contains the number of media type strings in the rgszTypesarray. This parameter cannot be zero.

rgszTypes

[in] Address of an array of strings identifying the media types to be registered. None of these strings can be NULL.

rgclsID

[in] Address of an array of CLSIDs to associate with the media type strings in the rgszTypesarray.

dwReserved

[in] Reserved. Must be zero.

Return Value

Returns S_OK if successful or E_INVALIDARG if one or more parameters are invalid.

Remarks

The new mapping is used in calls to IMoniker::BindToObjectwhen binding objects in the specified bind context.

This function is primarily used by moniker clients calling IMoniker::BindToObjectto override the default registry mapping between MIME types and CLSIDs. In most cases, the default mapping provided in the registry is used. However, a Web browser might require the CLSID for its HTML viewer to be associated with .txt files without changing the default registry association for text files. The override is used for all bind operations using the specified bind context.

Requirements

Header urlmon.h, urlmon.idl
Library urlmon.lib
Windows Embedded CE Windows CE .NET 4.0 and later
Windows Mobile Windows Mobile Version 5.0 and later