AssocCreateElement

This function creates a specified type of association element and obtains a desired interface to it.

Declaration

HRESULT
AssocCreateElement (
    REFCLSID rclsid,
    REFIID riid,
    PVOID *ppv);

Parameters

The rclsid argument provides the CLSID of the desired element.

The riid argument provides the IID of a desired interface to the element.

The ppv argument provides the address of a variable that is to receive a pointer to the desired interface.

Return Value

The function returns zero for success, else an error code.

Behaviour

If the CLSID is not recognised as selecting a supported association element or if an instance of that element cannot be created, the function fails (returning CLASS_E_CLASSNOTAVAILABLE, with NULL stored at the address given by ppv). Otherwise, the function queries the newly created element for the desired interface.

Availability

The AssocCreateElement function is exported from SHELL32.DLL as ordinal 764 in the version 6.00 from Windows Vista, and higher. It has an earlier existence in SHLWAPI.DLL as an internal procedure to support undocumented cases of the otherwise documented function AssocCreate.

This function was not documented by Microsoft for the January 2007 edition of the Windows Vista Software Development Kit (SDK).