Hello, I am writing a simple Direct3D program. Using message boxes I have isolated the point where my code fails. The compiler doesn't recognize any errors. My program crashes when it reaches the code to create a Direct3D Device, and I don't know why. Please take a look at it and let me know if you have any suggestions on how to fix it. I am using VS 2010 and DirectX June 2010.
You are using DirextX 9 in your program if I'm not mistaken. What is the return value of CreateDevice() for your program tyler22? Possible values are D3D_OK (which is unlikely if this is the function causing the problem), D3DERR_DEVICELOST, D3DERR_INVALIDCALL, D3DERR_NOTAVAILABLE and D3DERR_OUTOFVIDEOMEMORY.
Also, since you don't get any compile errors, it is not unlikely you are supplying an improper value for one of your function parameters. You may want to double-check that all the parameters you give to CreateDevice() are correctly initialized and store the data they're supposed to store at that point in the program. You can use the debugger for keeping track of these and make sure it all runs smoothly up to the function call, no need to implement additional message boxes.
Also, CreateDevice() shouldn't be run during the handling of a WM_CREATE message.
Sorry, I am new to DirectX programming and Windows programming in general. How do I tell the return value of CreateDevice()? I am also fairly sure that my parameters are correct, yet I will post them anyhow. I am not using a WM_CREATE message in this program.