IOpcPartSet::PartExists method (msopc.h)
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
[in] name
A pointer to an IOpcPartUri that represents the part name of the part.
[out, retval] partExists
One of the following values:
Value | Meaning |
---|---|
|
A part that has the specified part name is represented in the set. |
|
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 code | Description |
---|---|
|
The method succeeded. |
|
The partExists parameter is NULL. |
|
An HRESULT error code from the Package Consumption Error Group. |
|
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
Requirement | Value |
---|---|
Minimum supported client | Windows 7 [desktop apps only] |
Minimum supported server | Windows Server 2008 R2 [desktop apps only] |
Target Platform | Windows |
Header | msopc.h |
See also
Getting Started with the Packaging API
Overviews
Reference