Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/146.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ C++;:不推荐x64使用A2W宏-备选方案?_C++_Macros_64 Bit_Pvs Studio - Fatal编程技术网

C++ C++;:不推荐x64使用A2W宏-备选方案?

C++ C++;:不推荐x64使用A2W宏-备选方案?,c++,macros,64-bit,pvs-studio,C++,Macros,64 Bit,Pvs Studio,我正在使用PVS studio将程序从x86转换为x64。在PVS Studio中执行分析运行后,每次使用atlconv.h中定义的A2W宏时,我都会收到以下与x64相关的警告: V303 The function 'lstrlen' is deprecated in the Win64 system. It is safer to use the 'wcslen' function. V104 Implicit conversion of '_convert' to memsize type

我正在使用PVS studio将程序从x86转换为x64。在PVS Studio中执行分析运行后,每次使用atlconv.h中定义的A2W宏时,我都会收到以下与x64相关的警告:

V303 The function 'lstrlen' is deprecated in the Win64 system. It is safer to use the 'wcslen' function.
V104 Implicit conversion of '_convert' to memsize type in an arithmetic expression: _convert * sizeof (WCHAR) 
V107 Implicit type conversion third argument '_convert * sizeof (WCHAR)' of function 'AtlW2AHelper' to 32-bit type.

既然atlconv超出了我的能力范围,我是否应该忽略这些警告,或者在x64上执行A2W宏的首选方法是什么

如果这对其他人有帮助,我确实使用了CStringW构造函数解决了它。

我认为这些ATL 3.0宏已被弃用。 由于ATL 7.0提供了新的转换类。


在大多数情况下,将A2W宏替换为CA2W类就足够了。

在您的项目中使用了多少次
A2W
?那个宏是个黑客,我想有几百个。相当大的项目:(您可以检查宏实现并使用更合适的函数复制hack,将其称为
Ascii2WideHack
,并进行全局搜索和替换?@Yakk感谢您的回复!没错,不过,也许简单地使用CStringW构造函数就可以将ansi转换为unicode?谢谢,这是我没有提到的有趣信息知道!正如我不久前写的,我通过CStringT()构造函数解决了这个问题,但是知道这个很好。