# [fixed] Freeze at CreateDevice()

This topic is 3869 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Heya GameDev! I've got a problem with setting up my Direct3DSystem, and I was wondering if you guys could help me out. Whenever I'm debugging (VSC++EE) my code and the debugger reaches this line of code:
if(FAILED(m_pD3D->CreateDevice(D3DADAPTER_DEFAULT, (m_bHAL) ? D3DDEVTYPE_HAL : D3DDEVTYPE_REF, hWnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &m_D3Dpp, &m_pD3DDevice)))


and I press F11 to go to the next line, the debugger, the app...everything freezes. These are my D3DPRESENT_PARAMETER settings:
m_D3Dpp.Windowed			= bWindowed;
m_D3Dpp.SwapEffect			= D3DSWAPEFFECT_FLIP;
m_D3Dpp.BackBufferWidth			= m_nWidth;
m_D3Dpp.BackBufferHeight		= m_nHeight;
m_D3Dpp.FullScreen_RefreshRateInHz	= D3DPRESENT_RATE_DEFAULT;
m_D3Dpp.PresentationInterval		= D3DPRESENT_INTERVAL_IMMEDIATE;
m_D3Dpp.BackBufferFormat		= Format;


I'm going fullscreen, and doing this through a DLL. Does anyone know where the problem could lie? If you need anymore information, please be so kind to ask. Thanks for helping me out, - Stijn [Edited by - stenny on June 16, 2008 4:13:10 PM]

##### Share on other sites
Does it work if you don't do it "through a DLL?"

##### Share on other sites
So break into the debugger while it's frozen and take a look. What is it doing? Remember to set up with the Microsoft symbol server and look at all the running threads.

##### Share on other sites
Quote:
 Original post by BuckeyeDoes it work if you don't do it "through a DLL?"

Yeah, sorry. I knew I was a bit too abstract with that term. My whole Direct3D engine is stored inside a DLL. I'll try and see if these same settings work in a testproject without the DLL.

Quote:
 Original post by PromitSo break into the debugger while it's frozen and take a look. What is it doing? Remember to set up with the Microsoft symbol server and look at all the running threads.

That's the problem, the debugger freezes too. And I wouldn't have a clue as to what that Microsoft Symbol Server is and how to set it up, sorry :p. I guess I'm not that advanced yet.

##### Share on other sites
When I put all code in another project, I came accross the fact that the WinAPI's ShowWindow() and UpdateWindow() functions hadn't been called before Direct3D was initialized. Apparently HWND's aren't completely functional when those functions haven't been called yet. Anyway, calling them worked.

Thanks for helping out guys, and sorry for making such a stupid (oh well, I learnt from it ;D) mistake.

- Stijn

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 10
• 11
• 13
• 9
• 11
• ### Forum Statistics

• Total Topics
634092
• Total Posts
3015439
×