IOpcRelationship::GetSourceUri method

Gets the URI of the relationship source.

Syntax


HRESULT GetSourceUri(
  [out, retval] IOpcUri **sourceUri
);

Parameters

sourceUri [out, retval]

A pointer to the IOpcUri interface of the OPC URI object that represents the URI of the relationship source.

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 sourceUri parameter is NULL.

 

Remarks

If the source of a relationship is the package itself, the URI in sourceUri represents the package root: "/".

If the relationship  target is a part, form the part name by calling the IOpcUri::CombinePartUri method from the IOpcUri interface pointer received in sourceUri. Use the relative URI received in the targetUri parameter of the GetTargetUri method as the input parameter of the IOpcUri::CombinePartUri call. For an example, see Resolving a Part Name from a Target URI.

For more information about relationships, 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

IOpcRelationship
Overviews
Resolving a Part Name from a Target URI
Getting Started with the Packaging API
Open Packaging Conventions Fundamentals
Relationships Overview
Reference
Packaging API Reference
Packaging API Samples
External Resources
ECMA-376 OpenXML

 

 

Community Additions

ADD
Show: