共用方式為


IXpsOMNameCollection::GetAt 方法 (xpsobjectmodel.h)

取得儲存在集合中指定位置的名稱字串。

語法

HRESULT GetAt(
  [in]          UINT32 index,
  [out, retval] LPWSTR *name
);

參數

[in] index

集合之以零起始的索引,其中包含要取得的名稱字串。

[out, retval] name

索引 所指定位置的名稱字串。

傳回值

如果方法成功,它會傳回S_OK;否則會傳回 HRESULT 錯誤碼。

備註

如需集合方法的詳細資訊,請參閱 使用 XPS OM 集合介面

這個方法會配置 名稱中傳回之字串所使用的記憶體。 如果 name 不是 NULL,請使用 CoTaskMemFree 函式釋放記憶體。

規格需求

需求
最低支援的用戶端 適用於 Windows Vista 的 Windows 7、Windows Vista SP2 和平臺更新 [傳統型應用程式 |UWP 應用程式]
最低支援的伺服器 Windows Server 2008 R2、Windows Server 2008 SP2 和 Platform Update for Windows Server 2008 [傳統型應用程式 |UWP 應用程式]
目標平台 Windows
標頭 xpsobjectmodel.h

另請參閱

IXpsOMNameCollection

使用 XPS OM 集合介面

XML Paper Specification