wsprint如何与TCHAR一起使用

时间:2018-11-16 12:40:22

标签: c++

我无法在日志文件中打印

CString strCmdLine = GetCommandLine();
WCHAR strLogData[80];
CString strFormat;`

WCHAR strExeName[40];
WCHAR strCmdParameter[40],
WCHAR strToolName[40];
WCHAR strAuthcode[40];
WCHAR strUsername[40];
WCHAR strUtilityVersion[40];
WCHAR strPCID[40];

strFormat = _T("%[^ ],%[^ ],%[^ ],%[^ ],%[^ ]");`
swscanf_s(strCmdLine, strFormat, strExeName, sizeof(strExeName),
          strCmdParameter, sizeof(strCmdParameter), strToolName, 
          sizeof(strToolName), strAuthcode, sizeof(strAuthcode),
          strUsername, sizeof(strUsername), strUtilityVersion, 
          sizeof(strUtilityVersion), strPCID, sizeof(strPCID));

wsprintf(strLogData,_T("Launching RTOP DELETE UTILITY - %s"), strUtilityVersion);
m_pLogFile->AppendLogData(strLogData);

strUtilityVersion未打印到日志文件。

0 个答案:

没有答案