Hi I have a source code working fine when compiled using vs2008, in 32 bit. Now I am trying to compile the same source code in 64bit. For this piece of code:
if(EnumResourceLanguages(gHResources, RT_STRING, MAKEINTRESOURCE(1),EnumLangProc, 0) && (0 < gNumSupportedLangs))
I am getting the following error:
Error: error C2664: 'EnumResourceLanguagesA' : cannot convert parameter 4 from 'BOOL (__cdecl *)(HMODULE,LPCTSTR,LPCTSTR,WORD,LONG)' to 'ENUMRESLANGPROCA'
Can any help me with how to get rid of it?
Your 4th parameter of the callback is defined as
LONG. TheEnumResLangProcexpectsLONG_PTRas 4th parameter. This is a bug in the code but in 32-bitLONGis the same size asLONG_PTR(4 bytes) so it compiles fine. In 64-bitLONG_PTRis 8 bytes long so you get an error. Change your callback signature to acceptLONG_PTRas 4th parameter and it will compile for both 32 and 64 bit.