IOpcRelationship::GetId method

Gets the unique identifier of the relationship.

Syntax


HRESULT GetId(
  [out, retval] LPCWSTR *relationshipIdentifier
);

Parameters

relationshipIdentifier [out, retval]

The identifier of the relationship.

The identifier of a relationship is arbitrary and local to the package, and, therefore, .

Valid identifiers conform to the restrictions for xsd:ID, which are documented in section 3.3.8 ID of the W3C Recommendation, XML Schema Part 2: Datatypes Second Edition (http://go.microsoft.com/fwlink/p/?linkid=126664).

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

 

Remarks

The identifier of a relationship is not useful for finding relationships because it is arbitrary and local to the package.

The definitive way to find a part of interest is by using a relationship type.

Finding a part requires several steps. For detailed information about finding a part, see Finding the Core Properties Part.

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

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
Finding the Core Properties Part
Getting Started with the Packaging API
Open Packaging Conventions Fundamentals
Relationships Overview
Reference
IOpcRelationshipSet
Packaging API Reference
Packaging API Samples
External Resources
ECMA-376 OpenXML
W3C Recommendation, XML Schema Part 2: Datatypes Second Edition

 

 

Community Additions

ADD
Show: