This is going to be a bit weird but here we go.
Most programmers will have a header file specifying things for specific OS. What's in this header? Here's my example
1 2 3 4 5 6 7 8 9
#ifdef _WIN32//32 bit windows
#ifdef _WIN64//64 bit windows
#include <X11\X.h>//I forgot if that's the directory, it's been a while
Basically macros are defined within your compiler to assist you in this. Get the idea?
A 32-bit DLL cannot be loaded into a 64-bit process (except as just a data file); nor can a 64-bit DLL be loaded into a 32-bit process. So deciding whether to load a 32-bit or 64-bit DLL at runtime is invalid.
IsWow64Process returns TRUE if you're running a 32-bit process on a 64-bit version of Windows, using WOW64. It's still a 32-bit process and can therefore only load 32-bit DLLs.
The decision on whether to load the 32-bit or 64-bit version of the DLL needs to be made at compile time.