09-02-2015 02:13 AM - edited 09-02-2015 02:21 AM
I am glad it's not only me...
I just tried it with the following result:
GetLocaleInfoEx (LOCALE_NAME_USER_DEFAULT, LOCALE_SLIST, (LPWSTR)msg, 8);
DebugPrintf ("List separator: %s\n", msg);
in my source code works as expected, provided I add the compiler defne (VISTA or newer)
However, in the interactive execution, with the same compiler define, the following code
#include <windows.h>
static char msg[8];
GetLocaleInfoEx (LOCALE_NAME_USER_DEFAULT, LOCALE_SLIST, (LPWSTR)msg, 8);
gives an error:
Interactive Execution - 1 error, 1 warning
5, 62 warning: cast from 'char *' to 'LPWSTR' (aka 'unsigned short *') increases required alignment from 1 to 2
1, 1 error: Unresolved symbol: GetLocaleInfoEx
.... ah yes, and a question / suggestion... why is /DWINVER=_WIN32_WINNT_WIN7 not added by default - CVI2015 does not support Windows XP and VISTA anymore....?
09-02-2015 10:57 AM
My apologies for not having actually tested this before posting. I too was able to reproduce this linker error and, unlike the missing prototype compiler error, this one does seem to be related to the interactive window.
As best I can tell, you're running into a form of this issue. I can't explain why this happens for some SDK functions, but not for others -- even for functions that are also in kernel32.lib (e.g. LoadLibrary).
Wolfgang: I had forgotten that CVI 2015 no longer supports XP. You are correct. The default value of WINVER should not have been _WIN32_WINNT_WINXP. I've written CAR 544425 to address this.
Roberto: the macros are per-project (and per-build configuration!). You can look through this topic if you're ever unsure of the scope of some option in CVI.
09-02-2015 12:51 PM
@LuisG wrote:
Roberto: the macros are per-project (and per-build configuration!). You can look through this topic if you're ever unsure of the scope of some option in CVI.
Thank you for this list, I wasn't aware of this useful compilation.
09-02-2015 04:50 PM
That's indeed very useful: thank you for taking it to my attention! I'll save that page in my favourites.