Visual c++ 无法将参数1从';ATL::CString';至';const wchar_t*';

Visual c++ 无法将参数1从';ATL::CString';至';const wchar_t*';,visual-c++,Visual C++,对于这一行代码: int currentSnapshotHeight = _wtoi(ExecuteExternalProgram(L"current.png")); 我得到了这个错误: Error 1 error C2664: '_wtoi' : cannot convert parameter 1 from 'ATL::CString' to 'const wchar_t *' 如何修复?也许这会起作用 int currentSnapshotHeight = _wtoi(Exe

对于这一行代码:

   int currentSnapshotHeight = _wtoi(ExecuteExternalProgram(L"current.png"));
我得到了这个错误:

Error 1 error C2664: '_wtoi' : cannot convert parameter 1 from 'ATL::CString' to 'const wchar_t *'  
如何修复?

也许这会起作用

int currentSnapshotHeight = _wtoi(ExecuteExternalProgram(_T("current.png")));
还要检查项目的Unicode设置是否按预期设置。

尝试以下操作:

int currentSnapshotHeight = _wtoi((wchar_t*)ExecuteExternalProgram(L"current.png").GetBuffer());

ExecuteExternalProgramm()的原型是什么?