Is it ok to call MessageBox with an active device and swap chain? Just by chance I forgot to rename a compiled shader file... and the following code started to crash on the MessageBox line. But if I move the MessageBox line to below the FreeDirect3D call, the message box displays fine. I'm on on an AMD card with latest drivers running a sample D3D11 application in windowed mode.
Thanks!
This crashes.
[source lang="cpp"]// open vertex shaderstd::ifstream vsfile("002.vs", std::ios::binary); // oops! wrong filenameif(!vsfile) { MessageBox(GetMainWindow(), TEXT("Failed to open vertex shader file."), TEXT("Error"), MB_ICONSTOP); // crash! FreeDirect3D(); return FALSE; }[/source]
This works OK.
[source lang="cpp"]// open vertex shaderstd::ifstream vsfile("002.vs", std::ios::binary); // oops! wrong filenameif(!vsfile) { FreeDirect3D(); MessageBox(GetMainWindow(), TEXT("Failed to open vertex shader file."), TEXT("Error"), MB_ICONSTOP); // OK! return FALSE; }[/source]
EDIT: After some more testing, for me, any MessageBox called after D3D11CreateDeviceAndSwapChain but before a call to CreateVertexShader crashes atidxx32. Any MessageBox after the call to CreateVertexShader doesn't crash.
Full source code crashes on line 47 of d3dapp.cpp.
Edited by yadango, 05 August 2012 - 06:29 PM.






