You could try and re-install DirectX; it's downloadable from Microsoft.
It might also be worthwhile re-installing you GPU driver. Remove it, boot into Safe mode, and use Driver Sweeper to clean out any remnants. Then install the latest version.
Thanks,I'll try that. I've had this problem with two graphics cards,so I highly doubt both of them were defective. Also, when I go to the Microsoft website, I can only find directx 9 updates. Can you please post a link to the proper one that I should download?