Export (0) Print
Expand All

IOpcFactory interface

Creates Packaging API objects and provides support for saving and loading packages. Objects that are created by IOpcFactory interface methods provide support for creating, populating, modifying, and digitally signing packages.

When to implement

Never. Custom implementations of this interface are not supported.

Members

The IOpcFactory interface inherits from the IUnknown interface. IOpcFactory also has these types of members:

Methods

The IOpcFactory interface has these methods.

MethodDescription
CreateDigitalSignatureManager

Creates a digital signature manager object for a package object.

CreatePackage

Creates a package object that represents an empty package.

CreatePackageRootUri

Creates an OPC URI object that represents the root of a package.

CreatePartUri

Creates a part URI object that represents a part name.

CreateStreamOnFile

Creates a stream over a file.

ReadPackageFromStream

Deserializes package data from a stream and creates a package object to represent the package being read.

WritePackageToStream

Serializes a package that is represented by a package object.

 

Remarks

Do not use a stream to serialize package data when the same stream is being used to deserialize a package; attempting to do so may result in undefined behavior.

To use the Packaging API, the package must map to a ZIP archive as specified in the ECMA-376 OpenXML, 1st Edition, Part 2: Open Packaging Conventions (OPC).

To create a factory that implements the IOpcFactory interface, call the CoCreateInstance function. This factory is not tied to any particular package or Packaging API object, and it can be used for the lifetime of the application. For example code that shows how to create a factory implementing IOpcFactory, see the Getting Started with the Packaging API.

IOpcFactory Support on Previous Versions of Windows

If an application attempts to an unsupported IOpcFactory method, the E_NOTIMPL error code will be returned. 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 client

Windows 7, Windows Vista with SP2 and Platform Update for Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 R2, Windows Server 2008 with SP2 and Platform Update for Windows Server 2008 [desktop apps only]

Header

Msopc.h

IDL

Msopc.idl

See also

Core Packaging Interfaces
Overviews
Getting Started with the Packaging API
Packaging API Programming Guide
Platform Update for Windows Vista
Reference
IOpcDigitalSignatureManager
IOpcPackage
IOpcPartUri
IOpcUri
Packaging Digital Signature Interfaces
Packaging API Reference
Packaging API Samples
External Resources
ECMA-376 OpenXML

 

 

Community Additions

ADD
Show:
© 2014 Microsoft