Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


MessageBox and Direct3D11


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 yadango   Members   -  Reputation: 559

Like
0Likes
Like

Posted 05 August 2012 - 05:15 PM

Hey guys,
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.


Sponsor:

#2 MJP   Moderators   -  Reputation: 11736

Like
0Likes
Like

Posted 05 August 2012 - 10:31 PM

It's fine to use MessageBox in a windowed D3D11 app.

You've probably hit a driver bug, probably due to something in your shader that's breaking the JIT compiler used in the driver. Usually for things like this I will start commenting out blocks of code until I find whichever bit is causing the problem, and then I'll try to re-write that bit of code until I work around the bug.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS