Today, when debugging the project, I encountered a problem. When I was writing code, debugging was conducted on a local computer. However, today, I logged on to the computer remotely for debugging, therefore, a problem occurs during the debugging process.
In fact, at the beginning, some colleagues said that when a remote login was made to play, another person logged in and started to quit on the playing side. Then the player crashed. Then I read the printed information and thought it was the cause of the system, the missing library, or the incomplete library.
However, due to the urgent need, I checked the cause carefully. When I looked at the crash, the Windows system prompts a d3d. dll error.
Today, when I remotely went to my development computer for debugging, I encountered a problem, that is, playing well. Then, when I minimized the entire Remote Desktop, back to the local computer, and back to the remote desktop, the player crashed.
So I followed the program carefully. In our player, d3d is used to display videos. The amount of code is not very large, so it is called printing information in important functions.
Finally, repeat the above action, the player crashes, and then you can view it. The Player crashes:
If (m_pd3dsurface [ddpos] = NULL) return nret;
Switch (m_pd3ddevice [ddpos]-> testcooperativelevel () {// test the device loss status, that is, to detect the current status of the device
Case d3d_ OK: // everything is normal
Break;
Case d3derr_devicelost: // The device is lost.
Closedirectdraw ();
If (! This-> initdirectdraw ())
{
Closedirectdraw ();
Return 0;
}
Break ;;
Case d3derr_devicenotreset: // reset lost, reset
// M_pd3ddevice [ddpos]-> Reset (0); // location of bug -----
M_pd3ddevice [ddpos]-> Reset (& d3dpp); // modefy by lhp --- solve the above crash problem
Closedirectdraw ();
So I checked the information on the Internet and carefully checked the cause. I thought it was a problem that the reset function was called after the device was lost.
The first two essays are my own searches. I personally think that the documents are complete and can solve the problem, so I posted them for future reference.
Direct3d problems encountered in the project cause device loss