Share via


RegisterMediaTypeClass

Send Feedback

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 reserved
);

Parameters

  • pBC
    [in] Address of the IBindCtx interface 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 rgszTypes array. 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 rgszTypes array.
  • reserved
    [in] Reserved. Must be zero.

Return Values

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::BindToObject when binding objects in the specified bind context.

This function is primarily used by moniker clients calling IMoniker::BindToObject to override the default registry mapping between Multipurpose Internet Mail Extensions (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

Pocket PC: Pocket PC 2000 and later
Smartphone: Smartphone 2002 and later
OS Versions: Windows CE 3.0 and later
Header: urlmon.h
Library: urlmon.lib

See Also

URL Moniker Services Functions | RegisterMediaTypes

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.