IOpcPartSet::PartExists method

Gets a value that indicates whether a specified part is represented as a part object in the set.

Syntax


HRESULT PartExists(
  [in]          IOpcPartUri *name,
  [out, retval] BOOL        *partExists
);

Parameters

name [in]

A pointer to an IOpcPartUri that represents the part name of the part.

partExists [out, retval]

One of the following values:

ValueMeaning
TRUE

A part that has the specified part name is represented in the set.

FALSE

A part that has the specified part name is not represented in the set.

 

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

Package Consumption error

An HRESULT error code from the Package Consumption Error Group.

Part URI error

An HRESULT error code from the Part URI Error Group.

 

Remarks

To retrieve the IOpcPart interface pointer of the part object that represents a specific part, call the PartExists method and pass in the part name to confirm that the part is represented in the set. If it is, call the GetPart method and pass in the part name to retrieve the IOpcPart interface pointer.

If the represented part name is the name of a Relationships part, partExists is receives FALSE because Relationships parts are not included in the set.

If a part is represented in the set, the part exists in the package being read or the package to be written.

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

IOpcPartSet
Overviews
Getting Started with the Packaging API
Parts Overview
Reference
Packaging Errors
Packaging API Reference
Packaging API Samples

 

 

Community Additions

ADD
Show: