This error code is often caused by a DLL being compiled for the wrong architecture, so I guess that you have some 32-bit DLL in your original folder that is found instead of the 64-bit DLL.
That pointed me in the direction of the problem. For some reason on the computer I'm using I had only added the 32bit dll to the system path. I added the 64bit, logged out and logged back in and it worked.