I'm at my limit...This game uses the Library which is provided by my school.The same code works fine in my school's computer but not in my notebook.I've been debuging this days after days (although not continuously)

The HRESULT returned from CreateDevice has no problem as far as I can see. (the result was 0 I think)with the D3DCREATE_HARDWARE_VERTEXPROCESSING setting, the last trace is "pD3DDevice->Present.s"and the screen went frozen, leaves no error messages.with the D3DCREATE_SOFTWARE_VERTEXPROCESSING setting, it's extreamly slow. but won't freeze (maybe too slow to even not get to the point yet)since it has no error messages and it's un-debug-able...I've been googling for days, and still have no idea what's going on.

Actually, before this happened, I had "LNK1000: Internal error during IncrBuildImage" error at every compile.the hotfix VS90-KB948127 fixed it but still....it could be the problem of my graphic card...my graphic card is ATI Mobility Radeon X2300. a VAIO notebook probably 2 years old.

If it's computer then I had similar problem myself. It was driver issue. Driver wasn't checking whether all parameters are set and caused silent crash. Make sure you set primitive topology, shaders and other stuff.

Thanks to Tom's tip, I've managed to fix it!!I fix it by providing a D3DCREATE_MULTITHREADED tag to the CreateDevice().

I also received a huge amount of Direct3D9: (WARN) :Ignoring redundant SetSamplerState Sampler: 0, State: xxDirect3D9: (WARN) :Ignoring redundant SetRenderState xxeven I comment'em.guess there are ok I think.

and thanks to Ripiz too. but the froze was a program froze.I've also googled the primitive topology, it seems like it's a DX10 feature?Is there a equivalent feature/setting for the DX9? might as double check it.

D3DCREATE_MULTITHREADED is needed if the D3D device is used from more than one thread. Using the device from multiple threads is an extremely bad idea in D3D9, it has a fairly major performance penalty associated with it. If it's just for some test code then it's probably fine to use, but a "proper" game should never be using D3D from multiple threads.

If the library is provided by your school, then it must be creating the device from a different thread than your "main" thread.

and inside the OnLoading(), it's just for loops to load all the resources specified...
_LoadEnd is not been used anywhere but insides the above 2 functions.
as googled... think the WaitForSingleObject is needed but it's not been used.
I'm a lilo confused here...
so it created a new thread to load resource.
but not waiting for the loading to complete...

if that assumption is true, then probably it explains why the program yells LOADING FAIL occasionally.

ahyhow, I've restored everything back to what it was, but replaced Sys_CreateLoadThread() with the OnLoading()
so far, and I think it is sweet.

I DO think this API needs a rewrite...
besides this, I've caught quit some bugs too...