本文整理汇总了C++中CString::FormatV方法的典型用法代码示例。如果您正苦于以下问题:C++ CString::FormatV方法的具体用法?C++ CString::FormatV怎么用?C++ CString::FormatV使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CString
的用法示例。
在下文中一共展示了CString::FormatV方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddMsg
void COutputTabView::AddMsg(LPCTSTR szFmt, ...)
{
CMainFrame* pMainFrame = (CMainFrame*)::AfxGetMainWnd();
CString str;
// Format the message text
va_list argptr;
va_start(argptr, szFmt);
str.FormatV(szFmt, argptr);
va_end(argptr);
str.Replace(_T("\n"), _T("\r\n"));
CString strWndText;
m_editCtrl1.GetWindowText(strWndText);
strWndText += str;
m_editCtrl1.SetWindowText(strWndText);
//m_editCtrl1.SetSel(str.GetLength()-1, str.GetLength()-2, FALSE);
m_editCtrl1.LineScroll(-m_editCtrl1.GetLineCount());
m_editCtrl1.LineScroll(m_editCtrl1.GetLineCount()-4);
}
示例2: AddLogText
void CLoggable::AddLogText(bool debug, bool addtostatusbar, LPCTSTR line, va_list argptr)
{
ASSERT(line != NULL);
EMULE_TRY
#ifndef NEW_SOCKETS_ENGINE
if (debug && !g_App.m_pPrefs->GetVerbose())
return;
#endif //NEW_SOCKETS_ENGINE
CString sBuffer;
sBuffer.FormatV(line, argptr);
#ifndef NEW_SOCKETS_ENGINE
#ifdef _DEBUG
//SyruS (0.29c) view the log messages while shutting down at least in the debugger
if (g_App.m_app_state != g_App.APP_STATE_RUNNING)
TRACE("App Log: %s\n", sBuffer);
#endif
if (g_App.m_pMDlg)
g_App.m_pMDlg->AddLogText(addtostatusbar, sBuffer, debug); // debug log and normal log handled by the same subroutine now
#else //NEW_SOCKETS_ENGINE
g_stEngine.AddLog(debug ? LOG_DEBUG : LOG_WARNING, sBuffer);
#endif //NEW_SOCKETS_ENGINE
#ifdef _DEBUG
if (debug)
::OutputDebugString(sBuffer + _T("\n"));
#endif
EMULE_CATCH2
}
示例3: qprintf
void qprintf(const char* p_format,...)
{
CString string;
static CString stringRegister;
va_list vl;
va_start(vl,p_format);
string.FormatV(p_format,vl);
va_end(vl);
// See if we must just register the string
if(string.Right(3) == "<+>")
{
stringRegister += string.Left(string.GetLength() - 3);
return;
}
// Print the result to the logfile as INFO
string = stringRegister + string;
stringRegister.Empty();
AutoCritSec lock(&std_stream);
printf(string);
}
示例4: SetText
void CScrollTool::SetText(LPPOINT pos, const TCHAR * fmt, ...)
{
if (!m_bInitCalled)
{
ASSERT( 0 );
return;
}
CString s;
va_list marker;
va_start( marker, fmt );
s.FormatV(fmt, marker);
va_end( marker );
CSize textsize(0);
if (m_bRightAligned)
{
CDC *pDC = GetDC();
textsize = pDC->GetTextExtent(s);
ReleaseDC(pDC);
}
ti.lpszText = s.GetBuffer();
SendMessage(TTM_UPDATETIPTEXT, 0, (LPARAM)(LPTOOLINFO) &ti);
SendMessage(TTM_TRACKPOSITION, 0, MAKELONG(pos->x-textsize.cx, pos->y));
s.ReleaseBuffer();
}
示例5: LogMessage
void CApiLog::LogMessage(CString SourceFile, int nSourceLine, void *pInstance, int nMessageType, LPCTSTR pMsgFormat, ...) const
{
ASSERT(nMessageType>=4 && nMessageType<=8);
ASSERT(m_hTargetWnd || m_pApiLogParent);
ASSERT(nSourceLine>0);
int pos=SourceFile.ReverseFind(_MPT('\\'));
if (pos!=-1)
SourceFile=SourceFile.Mid(pos+1);
va_list ap;
va_start(ap, pMsgFormat);
CString text;
text.FormatV(pMsgFormat, ap);
va_end(ap);
#ifdef MPEXT
if (nMessageType>=FZ_LOG_DEBUG)
return;
#endif
CString msg;
msg.Format(_T("%s(%d): %s caller=0x%08x"), (LPCTSTR)SourceFile, nSourceLine, (LPCTSTR)text, (int)this);
SendLogMessage(nMessageType, msg);
}
示例6: Trace
static void Trace(const TCHAR* format, ...)
{
CString str;
va_list ptr; va_start(ptr, format);
str.FormatV(format, ptr);
va_end(ptr);
OutputDebugString( str);
}
示例7: AddStatusF
void CIrcWnd::AddStatusF(CString sLine, ...)
{
va_list argptr;
va_start(argptr, sLine);
CString sTemp;
sTemp.FormatV(sLine, argptr);
va_end(argptr);
AddStatus(sTemp);
}
示例8: LogFormatV
void CWinLogFile::LogFormatV(DWORD dwLogLevel, LPCWSTR lpszFormat, va_list args)
{
if (!IsLevelEnabled(dwLogLevel))
return;
CString strMessage;
strMessage.FormatV(lpszFormat, args);
Log(dwLogLevel, strMessage);
}
示例9:
WaitStatusCursor::WaitStatusCursor(UINT fmtid, ...)
{
va_list argp;
va_start(argp, fmtid);
CString msg;
msg.FormatV(theApp.LoadString(fmtid).c_str(), argp);
Create(NULL, IDC_WAIT, msg);
va_end(argp);
}
示例10: Log
void CClientDlg::Log( LPCTSTR pszFormat, ... )
{
va_list marker;
va_start( marker, pszFormat );
CString s;
s.FormatV( pszFormat, marker );
m_LogList.SetCurSel( m_LogList.AddString( s ) );
}
示例11: AddMailLogLine
void CLogActions::AddMailLogLine(const char *szFormat, ...)
{
va_list vaList;
va_start(vaList,szFormat);
CString sBuffer;
sBuffer.FormatV(szFormat,vaList);
va_end (vaList);
AddLogLine(GetLogFileName(DEFAULT_ANTISPAMLOG), sBuffer, objSettings.dwMaxMailLogFileSize);
}
示例12:
void CHtmlFile::_writeLine(const char* fmt, ...)
{
va_list arg;
va_start(arg, fmt);
CString temp;
temp.FormatV(fmt, arg);
va_end(arg);
m_buf += temp + "\r\n";
}
示例13:
Log& Log::appendf(LPCTSTR format, ...) {
CString s;
va_list v;
va_start(v, format);
s.FormatV(format, v);
DWORD size = s.GetLength();
WriteFile(hFile, (LPCVOID)s, size, &size, NULL);
return *this;
}
示例14: StrFormat
inline CString StrFormat(const char* format, ...)
{
CString str;
va_list ptr; va_start(ptr, format);
str.FormatV(format, ptr);
// Trace model: ATL::CTrace::s_trace.TraceV(m_pszFileName, m_nLineNo, dwCategory, nLevel, pszFmt, ptr);
va_end(ptr);
return str;
}
示例15: PostOutput
void PostOutput( TCHAR *TextAsPrintf, ... )
{
va_list argptr;
va_start( argptr, TextAsPrintf );
CString s;
s.FormatV( TextAsPrintf, argptr );
PostOutput(s);
}