“An attempt was made to load a program with an incorrect format” even when the platforms are the same

I’m calling functions from a 32-bit unmanaged DLL on a 64-bit system. What I get is: BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B) At first, I had my projects set to the Any CPU platform, so I changed them both to x86, but this error … Read more

How can I tell if I’m running in 64-bit JVM or 32-bit JVM (from within a program)?

How can I tell if the JVM in which my application runs is 32 bit or 64-bit? Specifically, what functions or properties I can used to detect this within the program? 12 s 12 For certain versions of Java, you can check the bitness of the JVM from the command line with the flags -d32 … Read more