5

我在 c++ windows 中编码。

INT64 dirID = -1;
CString querySQLStr = _T("");
querySQLStr.Format(L"select * from ImageInfo where FolderPath=%64d;", dirID);

querySQLStr always like this:
select * from ImageInfo where FolderPath=                                                            1214;

使用%64d对吗?非常感谢

4

3 回答 3

8

我没有方便的 Windows 机器来测试这个,但我认为 CString 应该接受这个:

querySQLStr.Format("%I64d", dirID);

可能值得注意的是,这是特定于 Windows 的,但由于您使用的是 CString,我想这没关系。

于 2010-06-18T08:29:12.403 回答
0

我认为你需要试试这个:

__int64 val;
......
ParamVal.Format( _T("%d{I64}"), val);
于 2015-03-15T14:13:42.367 回答
0

%lld%I64d也同样有效。

strCode.Format(_T("Code = %lld, Result = %I64d \n"),lCode,lResult);
于 2020-01-17T19:07:12.987 回答