从这里编译第一个片段:http://msdn.microsoft.com/en-us/library/ms682499(VS.85).aspx
得到: d:\!TC\cpp\control.cpp:4:21: fatal error: strsafe.h: No such file or directory compilation terminated.
我们(错误地)使用StringCbPrintfW来编写数据库查询,该查询在使用逗号作为小数分隔符的任何语言环境中都失败了.修复很容易,对吧?采用语言环境的StringCbPrintf_lW也在strsafe.h中定义.两者都定义如下:
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
Run Code Online (Sandbox Code Playgroud)
所以只需创建语言环境并用StringCbPrintf_lW替换StringCbPrintfW.
Intellisense很高兴,GoToDefinition很高兴,ClCompile不高兴.我一直在
错误C3861:'StringCbPrintf_lW':找不到标识符
有什么想法有什么不对?