To get a DirectX error message, there are two functions - DXGetErrorString() and DXGetErrorDescription() . However, FormatMessage() will not get you what you want. Here is a small example:
// You'll need this include file and library linked.
...
if (FAILED(hr)) { fprintf(stderr, "Error: %s error description: %s\n", DXGetErrorString(hr), DXGetErrorDescription(hr)); }
user405725
source share