sciwizeh 62 Posting Pro in Training

Hello I have a sample program from a book, it's not working properly, when the function d3d10createdeviceandswapchain is called the error checking causes the program to fail, after adding a few lines of code I found that the error code isn't one of the constants that the function is supposed to return, the code is -2147467263

I couldn't find anything on the code, does anyone have a suggestion?

Edit: when I pass the method the D3D10_DRIVER_TYPE_REFERENCE it doesn't throw that error, but the entire program as well as Visual Studio stop responding and both require task manager shut down