IOpcFactory::CreatePartUri Method
IOpcFactory::CreatePartUri Method

Creates a part URI object that represents a part name.

Syntax

HRESULT CreatePartUri(
  [in]           LPCWSTR pwzUri,
  [out, retval]  IOpcPartUri **partUri
);

Parameters

pwzUri [in]

A URI that represents the location of a part relative to the root of the package that contains it.

partUri [out]

A pointer to the IOpcPartUri interface of the part URI object. This object represents the part name derived from the URI passed in pwzUri.

Part names must conform to the syntax specified in the OPC.

Return Value

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

Return code/valueDescription
S_OK

The method succeeded.

E_POINTER

At least one of the pwzUri and partUri parameters is NULL.

OPC_E_NONCONFORMING_URI
0x80510001

A part name cannot be the empty string "".

OPC_E_NONCONFORMING_URI
0x80510001

A part name cannot be a '/'.

OPC_E_NONCONFORMING_URI
0x80510001

A part name cannot begin with "//".

OPC_E_NONCONFORMING_URI
0x80510001

A part name cannot end with a '/'.

OPC_E_NONCONFORMING_URI
0x80510001

A part name cannot end with a '.'.

OPC_E_NONCONFORMING_URI
0x80510001

A part name cannot have any segments that end with a '.'.

OPC_E_NONCONFORMING_URI
0x80510001

A part name cannot have fragment component. A fragment component is preceded by a '#' character, as described in RFC 3986: URI Generic Syntax.

OPC_E_NONCONFORMING_URI
0x80510001

A part name cannot be the name of a Relationships part that indicates another Relationships part as the source of the relationships contained therein.

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.

CreateUri function error

An HRESULT error code from the CreateUri function.

WinINet error

An HRESULT error code from a WinINet API.

 

Remarks

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
IDLMsopc.idl

See Also

IOpcFactory
Overviews
Getting Started with the Packaging API
Packaging API Programming Guide
Parts Overview
Platform Update for Windows Vista

 

Reference
CreateUri
Packaging Errors
Packaging API Reference
Packaging API Samples

 

External Resources
ECMA-376 OpenXML
RFC 3986: URI Generic Syntax

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