ID3D11ClassLinkage::GetClassInstance method (d3d11.h)

Gets the class-instance object that represents the specified HLSL class.

Syntax

HRESULT GetClassInstance(
  [in]  LPCSTR              pClassInstanceName,
  [in]  UINT                InstanceIndex,
  [out] ID3D11ClassInstance **ppInstance
);

Parameters

[in] pClassInstanceName

Type: LPCSTR

The name of a class for which to get the class instance.

[in] InstanceIndex

Type: UINT

The index of the class instance.

[out] ppInstance

Type: ID3D11ClassInstance**

The address of a pointer to an ID3D11ClassInstance interface to initialize.

Return value

Type: HRESULT

Returns S_OK if successful; otherwise, returns one of the Direct3D 11 Return Codes.

Remarks

For more information about using the ID3D11ClassLinkage interface, see Dynamic Linking.

A class instance must have at least 1 data member in order to be available for the runtime to use with ID3D11ClassLinkage::GetClassInstance. Any instance with no members will be optimized out of a compiled shader blob as a zero-sized object. If you have a class with no data members, use ID3D11ClassLinkage::CreateClassInstance instead.

Windows Phone 8: This API is supported.

Requirements

Requirement Value
Target Platform Windows
Header d3d11.h
Library D3D11.lib

See also

ID3D11ClassInstance

ID3D11ClassLinkage