.
Process by process debugging found that InitDevice() failed!
Statement by statement debugging found that the function D3D11CreateDeviceAndSwapChain was called in InitDevice(), and the runtime exited!
This issue arises because the function parameter createDeviceFlags is set incorrectly
DEBUG mode must be set to allow debugging in D3D mode.
Final solution:
Directly change to Release mode to run the program!
Alternatively, in Debug mode, comment out the following three lines of statements in the function InitDevice(), and the window will display successfully.