IOpcPart::GetContentType method

Gets the media type of part content.

Syntax


HRESULT GetContentType(
  [out, retval] LPCWSTR *contentType
);

Parameters

contentType [out, retval]

The media type of part content, as specified by the package format designer and adhering to RFC 2616: HTTP/1.1.

Return value

The method returns an HRESULT. Possible values include, but are not limited to, those in the following table.

Return codeDescription
S_OK

The method succeeded.

E_POINTER

The contentType parameter is NULL.

 

Remarks

This method allocates memory used by the string returned in contentType. If the method succeeds, call the CoTaskMemFree function to free the memory.

For more information about parts, see the Open Packaging Conventions Fundamentals and the ECMA-376 OpenXML, 1st Edition, Part 2: Open Packaging Conventions (OPC).

Thread Safety

Packaging objects are not thread-safe.

For more information, see the Getting Started with the Packaging API.

Requirements

Minimum supported client

Windows 7 [desktop apps only]

Minimum supported server

Windows Server 2008 R2 [desktop apps only]

Header

Msopc.h

IDL

Opcobjectmodel.idl

See also

IOpcPart
Overviews
Getting Started with the Packaging API
Open Packaging Conventions Fundamentals
Parts Overview
Reference
Packaging Errors
Packaging API Reference
Packaging API Samples
External Resources
ECMA-376 OpenXML
RFC 2616: HTTP/1.1

 

 

Community Additions

ADD
Show: