   DirectX Newbie
  Hi all,I''ve just started learning DirectX, using a book called "Game Programming All In One" by Bruno Miguel Teixera de Sousa on Visual Studio 6 SP6 (beta) with the DirectX 8 SDK.Unfortunately, there are quite a few mistakes in the book, almost all of which I''ve managed to solve, but a few which I can''t.First, I''m trying to draw by creating a surface or texture, running LockRect() on it and then drawing onto it.  Unfortunately, my program keeps on crashing when I try to lock the rectangle, but I managed to trace the error as D3DERR_INVALIDCALL.  I''m assuming that this error is caused because I call LockRect almost immediately after I create the object.  On one occasion, the code worked just fine for once, without being altered at all (I think the system was under significant load).Is there any way I can delay the LockRect() until the object is created? (please remember, I''m still fairly new at C++ as well).Another problem - I''m absolutely certain that I''m releasing all of my objects before the program shuts down, but on the occasion mentioned above that the program ran without issue, it crashed when I exitted as well, making it look as if an object isn''t being released properly.Is there any chance that this might NOT be related to this?One last thing - is there any way to add the DirectX functions, data types and structures to visual studio''s function list, etc?I can see functions like DirectDrawCreate() in the function list, but not Direct3DCreate8, and it''s getting annoying, having to keep referring to the help file, instead of just looking at the little yellow tooltip, to find the arguments and their orders?Thanks,Predatory Kangaroo 
  About the D3D Functions in the classview:quote:From Forum FAQ  You need to add the DirectX headers to your project. Preferably in another folder than the headers folder to avoid mixing them with your own project files. Note, you don"t have to move the files physically on your hard drive, just use Project->Add to Project->Files.Be warned, though, there are A LOT of functions, interfaces, structures, and enums that will be added.  So many that it is hard to identify your own.  You could always put them in a separate folder in the classView, though.;  Make sure you are using the debug DLLs in DirectX (use the DirectX control panel item to change this).  Then check the output window after you''ve run your program.  The debug DLLs will cause DirectX to output a debugging message to this window if there is a problem.  It should provide a more descriptive message about why your LockRect() call is failing, and it will also alert you if there are DirectX objects that you have not released.  That should help you track down both issues that you mentioned. ;  Thanks!Now I have all the DirectX functions once more, but should I install the DX 8 debug DLL, or the DX 9 debug DLL?Because I have DX 9 installed on this computer ;quote:Original post by Predatory Kangaroo  install the DX 8 debug DLL, or the DX 9 debug DLL?Because I have DX 9 installed on this computer   You should be using the DX9 debug runtimes.