IOpcUri::GetRelativeUri Method
IOpcUri::GetRelativeUri Method

Forms a relative URI for a specified part, relative to the URI represented by the current OPC URI object.

Syntax

HRESULT GetRelativeUri(
  [in]           IOpcPartUri *targetPartUri,
  [out, retval]  IUri **relativeUri
);

Parameters

targetPartUri [in]

A pointer to the IOpcPartUri interface of the part URI object that represents the part name from which the relative URI is formed.

relativeUri [out]

A pointer to the IUri interface of the URI of the part, relative to 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 codeDescription
S_OK

The method succeeded.

E_POINTER

At least one of the targetPartUri, and relativePartUri parameters is NULL.

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 IOpcPartUri representsCurrent IOpcUri representsReturned relative IUri represents
/mydoc/markup/page.xml /mydoc/markup/picture.jpg picture.jpg
/mydoc/markup/page.xml/mydoc/picture.jpg../picture.jpg
/mydoc/markup/page.xml/mydoc/images/pictures.jpg../images/pictures.jpg

 

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

Minimum supported clientWindows 7, Windows Vista with SP2 and Platform Update for Windows Vista
Minimum supported serverWindows Server 2008 R2, Windows Server 2008 with SP2 and Platform Update for Windows Server 2008
HeaderMsopc.h
IDLOpcparturi.idl

See Also

IOpcUri
Overviews
Getting Started with the Packaging API
Platform Update for Windows Vista

 

Reference
Packaging Errors
Packaging API Reference
Packaging API Samples

Send comments about this topic to Microsoft

Build date: 11/16/2009

© 2009 Microsoft Corporation. All rights reserved.   Terms of Use | Trademarks | Privacy Statement
Page view tracker
Rate the Lightweight library
x
Lightweight builds on ScriptFree (loband) by adding features you've requested: a SearchBox and default code language selection.
Do you like the SearchBox?
Do you like the tabbed code blocks?
How useful is this topic?
Tell us more.
Thanks
x
You're helping to improve MSDN Online.
Feedback
Switch View
Classic
Lightweight Beta
ScriptFree
Switch View