AssocCreateForClasses 函数 (shellapi.h)

检索实现 IQueryAssociations 接口的对象。

Syntax

SHSTDAPI AssocCreateForClasses(
  [in]  const ASSOCIATIONELEMENT *rgClasses,
  [in]  ULONG                    cClasses,
  [in]  REFIID                   riid,
  [out] void                     **ppv
);

参数

[in] rgClasses

类型: const ASSOCIATIONELEMENT*

指向 ASSOCIATIONELEMENT 结构的数组的指针。

[in] cClasses

类型: ULONG

rgClasses 指向的数组中的元素数。

[in] riid

类型: REFIID

对所需 IID 的引用,通常IID_IQueryAssociations。

[out] ppv

类型: void**

此方法返回时,包含 riid 中请求的接口指针。 这通常是 IQueryAssociations

返回值

类型:HRESULT

如果此函数成功,它将返回 S_OK。 否则,它将返回 HRESULT 错误代码。

注解

对于早于 Windows Vista 的系统,请使用 AssocCreate 函数。

要求

Requirement 价值
最低支持的客户端 Windows Vista [仅限桌面应用]
支持的最低服务器 Windows Server 2008 [仅限桌面应用]
目标平台 Windows操作系统
Header shellapi.h
Library OneCore.Lib
DLL Shell32.dll
API 集 ext-ms-win-shell-shell32-l1-2-2 (在 Windows 10 版本 10.0.14393 中引入)