RegisterMediaTypeClass

Registers a mapping of media types to CLSIDs to override the default mapping specified in the registry. The new mapping is used calls to IMoniker::BindToObject when binding objects in the specified bind context.

HRESULT RegisterMediaTypeClass(
  LPBC pbc,            //Pointer to the bind context
  UINT ctypes,         //Number of media type strings in rgszTypes
  LPCSTR  *rgszTypes,  //Pointer to array of media types to be 
                       // registered
  CLSID  *rgclsID,     //Pointer to array of CLSIDs corresponding to 
                       // rgszTypes
  DWORD  dwReserved    //Reserved for future use; must be zero
);
 

Parameters

pbc
[in] Pointer to the IBindCtx interface for the bind context in which the media types are to be registered.
ctypes
[in] Number of media type strings in the rgszTypes array. This parameter cannot be zero.
rgszTypes
[in] Pointer to an array of strings identifying the media types to be registered. None of these strings can be NULL.
rgclsID
[in] Pointer to an array of CLSIDs corresponding to the media type strings in the rgszTypes array.
dwReserved
[in] Reserved for future use; must be zero.

Return Values

S_OK
The operation was successful.
E_INVALIDARG
One or more parameters are invalid.

Remarks

This function is primarily used by moniker clients calling IMoniker::BindToObject to 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 may want 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.

QuickInfo

  Windows NT: Use version 5.0 or later.
  Windows: Unsupported.
  Windows CE: Unsupported.
  Header: Declared in urlmon.h.

See Also

RegisterMediaTypes