Yet another useful error code from Microsoft. It is quite possible that your code is somehow trying to link to a 32 bit DLL; try using Dependency Walker to track all the dependencies. Other than that you should try the Microsoft help sites.
Please check the return value again. 0x800700C1 seems to be wrong. The high word 0x8007 indicates that it is a normal Windows error code. But 0xC1 / 193 is ERROR_BAD_EXE_FORMAT: '%1 is not a valid Win32 application' which makes no sense here.