• Popular Now

• 15
• 15
• 11
• 9
• 10

Archived

This topic is now archived and is closed to further replies.

Trapping Errors within the DirectX 8.x Framework

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

Recommended Posts

Share on other sites
The reason E_FAIL is not being returned in because DisplayErrorMsg is telling the controlling window to close. Take a look again at the following code

  if( MSGERR_APPMUSTEXIT == dwType ){_tcscat( strMsg, _T("\n\nThis sample will now exit.") );MessageBox( NULL, strMsg, m_strWindowTitle, MB_ICONERROR|MB_OK );// Close the window, which shuts down the appif( m_hWnd )SendMessage( m_hWnd, WM_CLOSE, 0, 0 );}else

The comment says it all. Once this message is sent, all control of the program returns back to windows and execution stop. If you want E_FAIL to be returned, then you should look for an E_FAIL in the calling function, ( presumably Run() or Main() ), then call DisplayErrorMsg there.

-----------------------------
kevin@mayday-anime.com
http://games.mayday-anime.com