There are few ways to solve this problem. You can reinstal your DirectX9 from original website or from installer. You can find it on dvd's with games. You can also try to download strictly d3dx9_31.dll fro any dll library, for example http://fix4dll.com
and move it so your windows/system32 folder. Then reboot your PC and it should be fine.