Sometimes you HAVE to make small changes in your code for it to compile for both x86 and x64 code. To do that, add the following statements into your code.
1.
#ifdef _M_X64
2.
// 64bit code here
3.
#else
4.
// 32bit code here
5.
#endif