Our focus is on 32-bit, but sometimes we need a 64-bit build of our program, so the 64-bit warning option is always on.
More information about how to reproduce them:
Build the 32-bit target of ProfUIS Lib.
The option "Detect 64-bit Portability Issues" is disabled there.
I’ve further looked into the problem, and I am now not so sure if this is a problem in the profuis code.
The 64bit version of profuis compiles without warnings, so this is good.
It’s just that the "Detect 64-bit Portability Issues" option will trigger a warning in a 32-bit compilation at any conversion of a pointer to a DWORD (or other 32-bit type).
The windows api, as you stated in one of your replies, "conveniently" returns a DWORD for GetClassLong.
The HICON however is defined as a pointer.
So the typeconversion from DWORD to HICON will trigger a warning.
This can be solved in ProfUis by code like this:
replace hIcon = (HICON)
hIcon = (HICON)(DWORD_PTR) ::__EXT_MFC_GetClassLong(...
i.e. add an explicit conversion to a pointer. You can also change the #define __EXT_MFC_GetClassLong GetClassLongPtr so it has the extra cast.........
This shouldn’t have an impact on a 64-bit build and it will "fool" the "Detect 64-bit Portability Issues" option.
Adding these conversions to all of your code base would be tedious and it will clutter your own code base with unnecessary stuff.
However, this shouldn’t be necessary, as I find this issue basically a limitation of the MFC and Windows API wrt the "Detect 64-bit Portability Issues" option.