FormatMessage not working for HRESULTs returned by Direct3D 11 I am using Windows 7 x64 and Visual Studio 17 (v15.9.7). Say I try to create a swap chain using IDXGIFactory2 CreateSwapChainForHwnd and pass in DXGI SCALING NONE. I will get the following message in debug output (if I have enabled Direct3D debugging) DXGI ERROR IDXGIFactory CreateSwapChain DXGI SCALING NONE is only supported on Win8 and beyond. DXGI SWAP CHAIN DESC SwapChainType ... HWND, BufferDesc DXGI MODE DESC1 Width 816, Height 488, RefreshRate DXGI RATIONAL Numerator 0, Denominator 1 , Format B8G8R8A8 UNORM, ScanlineOrdering ... UNSPECIFIED, Scaling ... UNSPECIFIED, Stereo FALSE , SampleDesc DXGI SAMPLE DESC Count 1, Quality 0 , BufferUsage 0x20, BufferCount 2, OutputWindow 0x0000000000290738, Scaling ... NONE, Windowed TRUE, SwapEffect ... FLIP SEQUENTIAL, AlphaMode ... UNSPECIFIED, Flags 0x0 MISCELLANEOUS ERROR 175 The function returns 0x887a0001 in form of a HRESULT. If I put err,hr in the watch window, I get a nice error message there ERROR MOD NOT FOUND The specified module could not be found. However, if I pass this HRESULT to FormatMessage, it just puts NULL in the output and returns 0. err,hr helpfully informs me that the new error is ERROR MR MID NOT FOUND The system cannot find message text for message number 0x 1 in the message file for 2. My questions are Why is FormatMessage not giving me right error string (the one starting with ERROR MOD NOT FOUND...)? Where is Visual Studio getting these pretty error strings from? Can I get them too? Who do I pay? PS. I am using the Windows 10 SDK version of DX11, not the older DirectX SDK version. Thus, I can't really link to dxerr.lib either. This is the code that is used to print the error message LPTSTR error text NULL FormatMessage(FORMAT MESSAGE FROM SYSTEM FORMAT MESSAGE ALLOCATE BUFFER FORMAT MESSAGE IGNORE INSERTS, NULL, hr, MAKELANGID(LANG NEUTRAL, SUBLANG DEFAULT), (LPTSTR) amp error text, 0, NULL)