当前位置: 首页>>代码示例>>C++>>正文


C++ CString::FormatV方法代码示例

本文整理汇总了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);

}
开发者ID:Spritutu,项目名称:AiPI-1,代码行数:25,代码来源:OutputTabView.cpp

示例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
}
开发者ID:rusingineer,项目名称:EmulePlus,代码行数:35,代码来源:Loggable.cpp

示例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);
}
开发者ID:edwig,项目名称:Marlin,代码行数:25,代码来源:TestServer.cpp

示例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();
}
开发者ID:Kasper8660,项目名称:tortoisesvn,代码行数:28,代码来源:ScrollTool.cpp

示例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);
}
开发者ID:valery-barysok,项目名称:Far-NetBox,代码行数:28,代码来源:ApiLog.cpp

示例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);
}
开发者ID:johnmichaloski,项目名称:Adapter---fanuc-iSeries,代码行数:8,代码来源:service.cpp

示例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);
}
开发者ID:brolee,项目名称:EMule-GIFC,代码行数:9,代码来源:IrcWnd.cpp

示例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);
}
开发者ID:dreamsxin,项目名称:PcManager,代码行数:9,代码来源:winlogfile.cpp

示例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);
}
开发者ID:YueLinHo,项目名称:WinMerge,代码行数:9,代码来源:WaitStatusCursor.cpp

示例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 ) );
}
开发者ID:AlexWMF,项目名称:Carberp,代码行数:9,代码来源:ClientDlg.cpp

示例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);
}
开发者ID:calupator,项目名称:wiredplane-wintools,代码行数:9,代码来源:LogActions.cpp

示例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";
}
开发者ID:amate,项目名称:PeerCastPX,代码行数:10,代码来源:PecaCore.cpp

示例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;
}
开发者ID:Ascension64,项目名称:TobEx,代码行数:10,代码来源:log.cpp

示例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;

}
开发者ID:mtconnect,项目名称:iso_133399,代码行数:10,代码来源:cutting_tool_schema_armTest.cpp

示例15: PostOutput

void PostOutput( TCHAR *TextAsPrintf, ... )
{
	va_list argptr;
	va_start( argptr, TextAsPrintf );
	
	CString s;
	s.FormatV( TextAsPrintf, argptr );

	PostOutput(s);
}
开发者ID:MGraefe,项目名称:deferred,代码行数:10,代码来源:OutputWnd.cpp


注:本文中的CString::FormatV方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。