Happens to me too. Not just when I'm docking or undocking. I've been in the middle of a fire fight when it crashes on me. I get a CODE0 or CODE1. And I have made sure that Directx is enabled, and I have added my graphics card by following the guide on the "Advise and Tips" page.