Compartir a través de


IXpsOMDictionary::InsertAt method

Inserts an IXpsOMShareable interface at a specified location in the dictionary and sets the key to identify the interface.

Syntax

HRESULT InsertAt(
  [in] UINT32          index,
  [in] LPCWSTR         key,
  [in] IXpsOMShareable *entry
);

Parameters

  • index [in]
    The zero-based index in the dictionary where the IXpsOMShareable interface is to be inserted.

  • key [in]
    The key to be used to identify the IXpsOMShareable interface in the dictionary.

    The string referenced by key must be unique in the dictionary.

  • entry [in]
    The IXpsOMShareable interface pointer to be inserted at the location specified by index.

    A dictionary cannot contain duplicate interface pointers. This parameter must contain an interface pointer that is not already in the dictionary.

Return value

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
S_OK

The method succeeded.

XPS_E_NO_CUSTOM_OBJECTS

entry does not point to a recognized interface implementation. Custom implementation of XPS Document API interfaces is not supported.

 

Remarks

The interface pointers stored in the dictionary will usually be pointers to interfaces, such as IXpsOMBrush and IXpsOMVisual, that are derived from the IXpsOMShareable interface. To determine the interface type, call the IXpsOMShareable::GetType method.

At the location specified by index, this method inserts the IXpsOMShareable interface pointer and sets the key; the interface pointer and key are passed in value and key, respectively. Before value and key are inserted, the interface pointer and the key at this and all subsequent locations are moved up by one index.

The figure that follows illustrates how the dictionary is changed by the InsertAt method.

A figure that shows how InsertAt adds an entry to the dictionary

Requirements

Minimum supported client

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

Minimum supported server

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

Header

Xpsobjectmodel.h

IDL

XpsObjectModel.idl

See also

IXpsOMDictionary

IXpsOMShareable

XPS Document Errors

XML Paper Specification