UID | title | description | helpviewer_keywords | old-location | tech.root | ms.assetid | ms.date | ms.keywords | req.header | req.include-header | req.target-type | req.target-min-winverclnt | req.target-min-winversvr | req.kmdf-ver | req.umdf-ver | req.ddi-compliance | req.unicode-ansi | req.idl | req.max-support | req.namespace | req.assembly | req.type-library | req.lib | req.dll | req.irql | targetos | req.typenames | req.redist | ms.custom | f1_keywords | dev_langs | topic_type | api_type | api_location | api_name | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
NF:xpsobjectmodel.IXpsOMObjectFactory.CreatePackage |
IXpsOMObjectFactory::CreatePackage (xpsobjectmodel.h) |
Creates an IXpsOMPackage interface that serves as the root node of an XPS object model document tree. |
|
xps\ixpsomobjectfactory_createpackage.htm |
xps |
c9319997-6c8f-4e2c-9401-ad269e3db8c8 |
12/05/2018 |
CreatePackage, CreatePackage method [XPS Documents and Packaging], CreatePackage method [XPS Documents and Packaging],IXpsOMObjectFactory interface, IXpsOMObjectFactory interface [XPS Documents and Packaging],CreatePackage method, IXpsOMObjectFactory.CreatePackage, IXpsOMObjectFactory::CreatePackage, xps.ixpsomobjectfactory_createpackage, xpsobjectmodel/IXpsOMObjectFactory::CreatePackage |
xpsobjectmodel.h |
Windows |
Windows 7, Windows Vista with SP2 and Platform Update for Windows Vista [desktop apps \| UWP apps] |
Windows Server 2008 R2, Windows Server 2008 with SP2 and Platform Update for Windows Server 2008 [desktop apps \| UWP apps] |
XpsObjectModel.idl |
Windows |
19H1 |
|
|
|
|
|
|
Creates an IXpsOMPackage interface that serves as the root node of an XPS object model document tree.
A pointer to the new IXpsOMPackage interface.
The method returns an HRESULT. Possible values include, but are not limited to, those in the table that follows. For information about XPS document API return values that are not listed in this table, see XPS Document Errors.
Return code | Description |
---|---|
|
The method succeeded. |
|
package is NULL. |
The code example that follows illustrates how this method is used to create a new interface.
IXpsOMPackage *newInterface;
// Note the implicit requirement that CoInitializeEx
// has previously been called from this thread.
hr = CoCreateInstance(
__uuidof(XpsOMObjectFactory),
NULL,
CLSCTX_INPROC_SERVER,
__uuidof(IXpsOMObjectFactory),
reinterpret_cast<LPVOID*>(&xpsFactory)
);
if (SUCCEEDED(hr))
{
hr = xpsFactory->CreatePackage (&newInterface);
if (SUCCEEDED(hr))
{
// use newInterface
newInterface->Release();
}
xpsFactory->Release();
}
else
{
// evaluate HRESULT error returned in hr
}
For information about using IXpsOMPackage interface in a program, see Create a Blank XPS OM.