IOpcUri::CombinePartUri method (msopc.h)

Forms the part name of the part that is referenced by the specified relative URI. The specified relative URI of the part is resolved against the URI represented as the current OPC URI object.

Syntax

HRESULT CombinePartUri(
  [in]          IUri        *relativeUri,
  [out, retval] IOpcPartUri **combinedUri
);

Parameters

[in] relativeUri

A pointer to the IUri interface of the relative URI of the part.

To form the part URI object that represents the part name, this input URI is resolved against the URI represented as the current OPC URI object. Therefore, the input URI must be relative to the URI represented by the current OPC URI object.

This URI may include a fragment component; however, the fragment will be ignored and will not be included in the part name to be formed. A fragment component is preceded by a '#', as described in RFC 3986: URI Generic Syntax.

[out, retval] combinedUri

A pointer to the IOpcPartUri interface of the part URI object that represents the part name.

The part URI object is formed by resolving the relative URI in relativeUri against the URI represented by the current OPC URI object.

Return value

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

Return code/value Description
S_OK
The method succeeded.
E_FAIL
The CoInternetCombineUrl function returned an invalid size.
E_POINTER
At least one of the relativeUri, and combinedUri parameters is NULL.
E_UNEXPECTED
The size of the buffer required by the CoInternetCombineUrl function changed unexpectedly.
OPC_E_NONCONFORMING_URI
0x80510001
The part name does not conform to the rules specified in the OPC standards.
OPC_E_RELATIVE_URI_REQUIRED
0x80510002
A part name cannot be an absolute URI. An absolute URI begins with a schema component followed by a ":", as described in RFC 3986: URI Generic Syntax.
CoInternetCombineUrl function error
An HRESULT error code from the CoInternetCombineUrl function.
CreateUri function error
An HRESULT error code from the CreateUri function.
WinINet error
An HRESULT error code from a WinINet API.

Remarks

Example input and output:

Input relative IUri Current IOpcUri Formed IOpcPartUri
picture.jpg /mydoc/markup/page.xml /mydoc/markup/picture.jpg
../picture.jpg /mydoc/markup/page.xml /mydoc/picture.jpg
../../images/picture.jpg /mydoc/page.xml /images/picture.jpg
 

For information about how to use this method to help resolve a part name, see Resolving a Part Name from a Target URI.

Support on Previous Windows Versions

The behavior and performance of this method is the same on all supported Windows versions. For more information, see Getting Started with the Packaging API, and Platform Update for Windows Vista.

Thread Safety

Packaging objects are not thread-safe.

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

Requirements

Requirement Value
Minimum supported client Windows 7, Windows Vista with SP2 and Platform Update for Windows Vista [desktop apps | UWP apps]
Minimum supported server Windows Server 2008 R2, Windows Server 2008 with SP2 and Platform Update for Windows Server 2008 [desktop apps | UWP apps]
Target Platform Windows
Header msopc.h

See also

ECMA-376 OpenXML

External Resources

Getting Started with the Packaging API

IOpcUri

Overviews

Packaging API Reference

Packaging API Samples

Packaging Errors

Platform Update for Windows Vista

RFC 3986: URI Generic Syntax

Reference

Resolving a Part Name from a Target URI