0

我正在使用 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 宏的首选方式是什么?

4

2 回答 2

1

我相信这些 ATL 3.0 宏已被弃用。从 ATL 7.0 开始提供新的转换类。 http://msdn.microsoft.com/EN-US/library/87zae4a3(v=VS.120,d=hv.2).aspx

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

于 2017-03-13T16:37:31.157 回答
0

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

于 2015-10-06T06:41:34.963 回答