A common source for this error is loading a 32-bit DLL from a 64-bit application or vice versa.
So check your project settings (does the DLLs specified there match the application for 32 / 64-bit) and the DLLs loaded using
#pragma
statements.
You can also check the dependencies of your application using the
Dependency Walker (depends.exe) Home Page[
^].