ID3D11ClassLinkage::GetClassInstance method

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

Syntax

HRESULT GetClassInstance(
  LPCSTR              pClassInstanceName,
  UINT                InstanceIndex,
  ID3D11ClassInstance **ppInstance
);

Parameters

pClassInstanceName

Type: LPCSTR

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

InstanceIndex

Type: UINT

The index of the class instance.

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

   
Target Platform Windows
Header d3d11.h
Library D3D11.lib

See Also

ID3D11ClassInstance

ID3D11ClassLinkage