> ## Name

> cgD3D11TranslateHRESULT - convert an HRESULT into a string

> ## Synopsis

>     #include <Cg/cgD3D11.h>

>     const char * cgD3D11TranslateHRESULT( HRESULT hr );

> ## Parameters

> hr
>   The HRESULT to translate. Can be a generic HRESULT or a D3D runtime error.

> ## Return Values

> Returns a pointer to a string describing the error.

> ## Description

> cgD3D11TranslateHRESULT converts an HRESULT into a string.

> This routine will typically be called in debugging situations such as inside an error callback set using cgSetErrorCallback.

> ## Examples

>     char buf[512];
>     HRESULT hres = cgGetLastError();
>     if (FAILED(hres))
>     {
>         sprintf(buf, "A D3D error occurred. Error description: '%s'\n",
>                 cgD3D11TranslateHRESULT(hres));
>         OutputDebugString(buf);
>     }

> ## Errors

> None.

> ## History

> cgD3D11TranslateHRESULT was introduced in Cg 3.0.

> ## See Also

> cgD3D11TranslateCGerror, cgGetErrorString, cgSetErrorCallback