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


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

本文整理汇总了C++中CString::AppendFormat方法的典型用法代码示例。如果您正苦于以下问题:C++ CString::AppendFormat方法的具体用法?C++ CString::AppendFormat怎么用?C++ CString::AppendFormat使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CString的用法示例。


在下文中一共展示了CString::AppendFormat方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: FormatParamUsage

CString CSZCommandLineEx::FormatParamUsage(
    LPCTSTR         lpszParamName,
    CParamUsage&    usage, 
    int             nParamNameWidth,
    int             nValueNameWidth)
{
    assert(0 <= nParamNameWidth && nParamNameWidth <= 80);
    assert(0 <= nValueNameWidth && nValueNameWidth <= 80);


    CString strParamUsage;

    if (nValueNameWidth)
        nValueNameWidth += 3;   // for :<>

    // indent
    int nTruncateLength = 4;
    strParamUsage.AppendChar(_T(' '));
    strParamUsage.AppendChar(_T(' '));
    strParamUsage.AppendChar(_T(' '));
    strParamUsage.AppendChar(_T('-'));

    // param name
    nTruncateLength += nParamNameWidth;
    strParamUsage.Append(lpszParamName);
    for (int i = strParamUsage.GetLength(); i <= nTruncateLength; ++i)
    {
        strParamUsage.AppendChar(_T(' '));
    }
    strParamUsage.Truncate(nTruncateLength);


    // space
    nTruncateLength += 2;
    strParamUsage.AppendChar(_T(' '));
    strParamUsage.AppendChar(_T(' '));


    // param value
    nTruncateLength += nValueNameWidth;
    if (!usage.m_strParamValueName.IsEmpty())
        strParamUsage.AppendFormat(_T(":<%s>"), usage.m_strParamValueName);
    for (int i = strParamUsage.GetLength(); i <= nTruncateLength; ++i)
    {
        strParamUsage.AppendChar(_T(' '));
    }
    strParamUsage.Truncate(nTruncateLength);


    // space
    nTruncateLength += 4;
    strParamUsage.AppendChar(_T(' '));
    strParamUsage.AppendChar(_T(' '));
    strParamUsage.AppendChar(_T(' '));
    strParamUsage.AppendChar(_T(' '));


    // param usage
    strParamUsage.Append(usage.m_strUsage);
    return strParamUsage;
}
开发者ID:6520874,项目名称:pcmanager,代码行数:61,代码来源:szcmdlineex.cpp

示例2: ProcessPacket


//.........这里部分代码省略.........
							theApp.emuledlg->AddServerMessageLine(LOG_INFO, _T(""));
							if (cur_server) {
								CString strMsg;
								if (IsObfusicating())
									strMsg.Format(_T("%s: ") + GetResString(IDS_CONNECTEDTOOBFUSCATED) + _T(" (%s:%u)"), CTime::GetCurrentTime().Format(thePrefs.GetDateTimeFormat4Log()), cur_server->GetListName(), cur_server->GetAddress(), cur_server->GetObfuscationPortTCP());
								else
									strMsg.Format(_T("%s: ") + GetResString(IDS_CONNECTEDTO) + _T(" (%s:%u)"), CTime::GetCurrentTime().Format(thePrefs.GetDateTimeFormat4Log()), cur_server->GetListName(), cur_server->GetAddress(), cur_server->GetPort());
								theApp.emuledlg->AddServerMessageLine(LOG_SUCCESS, strMsg);
							}
						}
						theApp.emuledlg->AddServerMessageLine(LOG_INFO, message);
					}

					message = strMessages.Tokenize(_T("\r\n"), iPos);
				}
				break;
			}
			case OP_IDCHANGE:{
				if (thePrefs.GetDebugServerTCPLevel() > 0)
					Debug(_T("ServerMsg - OP_IDChange\n"));
				if (size < sizeof(LoginAnswer_Struct)){
					throw GetResString(IDS_ERR_BADSERVERREPLY);
				}
				LoginAnswer_Struct* la = (LoginAnswer_Struct*)packet;

				// save TCP flags in 'cur_server'
				CServer* pServer = NULL;
				ASSERT( cur_server );
				if (cur_server){
					if (size >= sizeof(LoginAnswer_Struct)+4){
						DWORD dwFlags = *((uint32*)(packet + sizeof(LoginAnswer_Struct)));
						if (thePrefs.GetDebugServerTCPLevel() > 0){
							CString strInfo;
							strInfo.AppendFormat(_T("  TCP Flags=0x%08x"), dwFlags);
							const DWORD dwKnownBits = SRV_TCPFLG_COMPRESSION | SRV_TCPFLG_NEWTAGS | SRV_TCPFLG_UNICODE | SRV_TCPFLG_RELATEDSEARCH | SRV_TCPFLG_TYPETAGINTEGER | SRV_TCPFLG_LARGEFILES | SRV_TCPFLG_TCPOBFUSCATION;
							if (dwFlags & ~dwKnownBits)
								strInfo.AppendFormat(_T("  ***UnkBits=0x%08x"), dwFlags & ~dwKnownBits);
							if (dwFlags & SRV_TCPFLG_COMPRESSION)
								strInfo.AppendFormat(_T("  Compression=1"));
							if (dwFlags & SRV_TCPFLG_NEWTAGS)
								strInfo.AppendFormat(_T("  NewTags=1"));
							if (dwFlags & SRV_TCPFLG_UNICODE)
								strInfo.AppendFormat(_T("  Unicode=1"));
							if (dwFlags & SRV_TCPFLG_RELATEDSEARCH)
								strInfo.AppendFormat(_T("  RelatedSearch=1"));
							if (dwFlags & SRV_TCPFLG_TYPETAGINTEGER)
								strInfo.AppendFormat(_T("  IntTypeTags=1"));
							if (dwFlags & SRV_TCPFLG_LARGEFILES)
								strInfo.AppendFormat(_T("  LargeFiles=1"));
							if (dwFlags & SRV_TCPFLG_TCPOBFUSCATION)
								strInfo.AppendFormat(_T("  TCP_Obfscation=1"));
							Debug(_T("%s\n"), strInfo);
						}
						cur_server->SetTCPFlags(dwFlags);
					}
					else
						cur_server->SetTCPFlags(0);

					// copy TCP flags into the server in the server list
					pServer = theApp.serverlist->GetServerByAddress(cur_server->GetAddress(), cur_server->GetPort());
					if (pServer)
						pServer->SetTCPFlags(cur_server->GetTCPFlags());
				}

				uint32 dwServerReportedIP = 0;
				uint32 dwObfuscationTCPPort = 0;
开发者ID:brolee,项目名称:EMule-GIFC,代码行数:67,代码来源:ServerSocket.cpp

示例3: OnBnClickedOk

void AccountDlg::OnBnClickedOk()
{
	CEdit* edit;
	CString str;
	CComboBox *combobox;
	int i;

	edit = (CEdit*)GetDlgItem(IDC_EDIT_SERVER);
	edit->GetWindowText(str);
	m_Account.server=str.Trim();

	edit = (CEdit*)GetDlgItem(IDC_EDIT_PROXY);
	edit->GetWindowText(str);
	m_Account.proxy=str.Trim();

	edit = (CEdit*)GetDlgItem(IDC_EDIT_DOMAIN);
	edit->GetWindowText(str);
	m_Account.domain=str.Trim();

	edit = (CEdit*)GetDlgItem(IDC_EDIT_AUTHID);
	edit->GetWindowText(str);
	m_Account.authID=str.Trim();

	edit = (CEdit*)GetDlgItem(IDC_EDIT_USERNAME);
	edit->GetWindowText(str);
	m_Account.username=str.Trim();

	edit = (CEdit*)GetDlgItem(IDC_EDIT_PASSWORD);
	edit->GetWindowText(str);
	m_Account.password=str.Trim();

	edit = (CEdit*)GetDlgItem(IDC_EDIT_DISPLAYNAME);
	edit->GetWindowText(str);
	m_Account.displayName=str.Trim();

	combobox= (CComboBox*)GetDlgItem(IDC_TRANSPORT);
	i = combobox->GetCurSel();
	switch (i) {
		case 1:
			m_Account.transport=_T("udp");
			break;
		case 2:
			m_Account.transport=_T("tcp");
			break;
		case 3:
			m_Account.transport=_T("tls");
			break;
		default:
			m_Account.transport=_T("");
	}

	edit = (CEdit*)GetDlgItem(IDC_STUN);
	edit->GetWindowText(str);
	m_Account.stun=str.Trim();

	m_Account.rememberPassword = 1;

	combobox= (CComboBox*)GetDlgItem(IDC_SRTP);
	i = combobox->GetCurSel();
	switch (i) {
		case 1:
			m_Account.srtp=_T("optional");
			break;
		case 2:
			m_Account.srtp=_T("mandatory");
			break;
		default:
			m_Account.srtp=_T("");
	}

	m_Account.publish = ((CButton*)GetDlgItem(IDC_PUBLISH))->GetCheck();

	m_Account.ice = ((CButton*)GetDlgItem(IDC_ICE))->GetCheck();

	m_Account.allowRewrite = ((CButton*)GetDlgItem(IDC_REWRITE))->GetCheck();

	combobox= (CComboBox*)GetDlgItem(IDC_PUBLIC_ADDR);
	i = combobox->GetCurSel();
	combobox->GetWindowText(m_Account.publicAddr);
	if (m_Account.publicAddr==Translate(_T("Auto")))
	{
		m_Account.publicAddr = _T("");
	}

	if (
		m_Account.domain.IsEmpty() ||
		m_Account.username.IsEmpty()) {
		CString str;
		str.Append(Translate(_T("Please fill out at least the required fields marked with *.")));
		str.AppendFormat(_T(" %s"),Translate(_T("Ask your SIP provider how to configure the account correctly.")));
		AfxMessageBox(str);
		return;
	}

	this->ShowWindow(SW_HIDE);

	if (!accountId) {
		Account dummy;
		int i = 1;
		while (true) {
//.........这里部分代码省略.........
开发者ID:iostrovs,项目名称:microsip-modified,代码行数:101,代码来源:AccountDlg.cpp

示例4: RefreshServer

void CServerListCtrl::RefreshServer(const CServer* server)
{
	if (!server || !theApp.emuledlg->IsRunning())
		return;

	LVFINDINFO find;
	find.flags = LVFI_PARAM;
	find.lParam = (LPARAM)server;
	int itemnr = FindItem(&find);
	if (itemnr == -1)
		return;

	CString temp;
	temp.Format(_T("%s : %i"), server->GetAddress(), server->GetPort());
	SetItemText(itemnr, 1, temp);
	SetItemText(itemnr, 0, server->GetListName());
	SetItemText(itemnr, 2, server->GetDescription());

	// Ping
	if (server->GetPing()) {
		temp.Format(_T("%i"), server->GetPing());
		SetItemText(itemnr, 3, temp);
	}
	else
		SetItemText(itemnr, 3, _T(""));

	// Users
	if (server->GetUsers())
		SetItemText(itemnr, 4, CastItoIShort(server->GetUsers()));
	else
		SetItemText(itemnr, 4, _T(""));

	// Max Users
	if (server->GetMaxUsers())
		SetItemText(itemnr, 5, CastItoIShort(server->GetMaxUsers()));
	else
		SetItemText(itemnr, 5, _T(""));

	// Files
	if (server->GetFiles())
		SetItemText(itemnr, 6, CastItoIShort(server->GetFiles()));
	else
		SetItemText(itemnr, 6, _T(""));

	switch (server->GetPreference()) {
		case SRV_PR_LOW:
			SetItemText(itemnr, 7, GetResString(IDS_PRIOLOW));
			break;
		case SRV_PR_NORMAL:
			SetItemText(itemnr, 7, GetResString(IDS_PRIONORMAL));
			break;
		case SRV_PR_HIGH:
			SetItemText(itemnr, 7, GetResString(IDS_PRIOHIGH));
			break;
		default:
			SetItemText(itemnr, 7, GetResString(IDS_PRIONOPREF));
	}
	
	// Failed Count
	temp.Format(_T("%i"), server->GetFailedCount());
	SetItemText(itemnr, 8, temp);

	// Static server
	if (server->IsStaticMember())
		SetItemText(itemnr, 9, GetResString(IDS_YES)); 
	else
		SetItemText(itemnr, 9, GetResString(IDS_NO));

	// Soft Files
	if (server->GetSoftFiles())
		SetItemText(itemnr, 10, CastItoIShort(server->GetSoftFiles()));
	else
		SetItemText(itemnr, 10, _T(""));

	// Hard Files
	if (server->GetHardFiles())
		SetItemText(itemnr, 11, CastItoIShort(server->GetHardFiles()));
	else
		SetItemText(itemnr, 11, _T(""));

	temp = server->GetVersion();
	if (thePrefs.GetDebugServerUDPLevel() > 0) {
		if (server->GetUDPFlags() != 0) {
			if (!temp.IsEmpty())
				temp += _T("; ");
			temp.AppendFormat(_T("ExtUDP=%x"), server->GetUDPFlags());
		}
	}
	if (thePrefs.GetDebugServerTCPLevel() > 0) {
		if (server->GetTCPFlags() != 0) {
			if (!temp.IsEmpty())
				temp += _T("; ");
			temp.AppendFormat(_T("ExtTCP=%x"), server->GetTCPFlags());
		}
	}
	SetItemText(itemnr, 12, temp);

	// LowID Users
	if (server->GetLowIDUsers())
		SetItemText(itemnr, 13, CastItoIShort(server->GetLowIDUsers()));
//.........这里部分代码省略.........
开发者ID:dalinhuang,项目名称:ffmpeg-port,代码行数:101,代码来源:ServerListCtrl.cpp

示例5: OnInitDialog

BOOL CPPageYoutube::OnInitDialog()
{
	__super::OnInitDialog();

	SetHandCursor(m_hWnd, IDC_COMBO1);

	AppSettings& s = AfxGetAppSettings();

	m_iYoutubeFormatCtrl.Clear();

	for (size_t i = 0; i < _countof(youtubeProfiles); i++) {
		CString fmt;
		switch (youtubeProfiles[i].type) {
		case y_mp4:
			fmt = L"MP4";
			break;
		case y_webm:
			fmt = L"WebM";
			break;
		case y_flv:
			fmt = L"FLV";
			break;
		case y_3gp:
			fmt = L"3GP";
			break;
#if ENABLE_YOUTUBE_3D
		case y_3d_mp4:
			fmt = L"3D MP4";
			break;
		case y_3d_webm:
			fmt = L"3D WebM";
			break;
#endif
#if ENABLE_YOUTUBE_DASH
		case y_dash_mp4_video:
			fmt = L"DASH MP4";
			break;
		case y_dash_webm_video:
			fmt = L"DASH WebM";
			break;
#endif
		default:
			continue;
		}
		fmt.AppendFormat(_T("@%dp"), youtubeProfiles[i].quality);

		m_iYoutubeFormatCtrl.AddString(fmt);
		m_iYoutubeFormatCtrl.SetItemData(i, youtubeProfiles[i].iTag);
	}

	int j = 0;
	for (j = 0; j < m_iYoutubeFormatCtrl.GetCount(); j++) {
		if (m_iYoutubeFormatCtrl.GetItemData(j) == s.iYoutubeTag) {
			m_iYoutubeFormatCtrl.SetCurSel(j);
			break;
		}
	}
	if (j >= m_iYoutubeFormatCtrl.GetCount()) {
		m_iYoutubeFormatCtrl.SetCurSel(0);
	}

	m_chkYoutubeLoadPlaylist.SetCheck(s.bYoutubeLoadPlaylist);

	m_nPercentMemoryCtrl.SetRange(1, 100);
	m_nMbMemoryCtrl.SetRange(1, 128);

	m_iYoutubeSourceType	= s.iYoutubeSource ? 1 : 0;
	m_iYoutubeMemoryType	= s.iYoutubeMemoryType ? 1 : 0;
	m_iYoutubePercentMemory	= s.iYoutubePercentMemory;
	m_iYoutubeMbMemory		= s.iYoutubeMbMemory;

	UpdateData(FALSE);

	UpdateMemoryCtrl();

	return TRUE;
}
开发者ID:Tphive,项目名称:mpc-be,代码行数:77,代码来源:PPageYouTube.cpp

示例6: ShowProgressCtrl

int CProgStatusBar::ShowProgressCtrl(){
	CPostMsg postmsg;
	if (!theApp.m_UimsgQueue.pop(postmsg))
	{
		return 1;
	}
	
	uistruct::BLOCKCHANGED_t pBlockchanged; 
	string strTemp = postmsg.GetData();
	pBlockchanged.JsonToStruct(strTemp.c_str());
	LogPrint("CProgStatusBar", "MSG_USER_UP_PROGRESS WM_CONNECTNET 更新进度条消息:%s\n",strTemp.c_str());
	if (pBlockchanged.tips <= 0)
	{
		return 1;
	}

	//// blocktip高度
	theApp.blocktipheight = pBlockchanged.tips ;
	if (!m_bProgressType)
	{
		string strTemp = "";
		strTemp = strprintf("%s%s",netStr , UiFun::UI_LoadString("PROGSTATUS_MODULE"  , "PROGSTATUS_NETWORK_SYNING",theApp.gsLanguage ));
		m_strNeting.SetWindowText(strTemp.c_str());
		m_strNeting.ShowWindow(SW_HIDE);
		m_strNeting.ShowWindow(SW_SHOW);

		m_progress.SetRange32( 0 , 100); 
		int  setpos =(int)((pBlockchanged.high*1.0/pBlockchanged.tips)*100) ;
		setpos = setpos>100?100:setpos;
		//设置进度条的值
		m_progress.SetPos(setpos);
		CString strText;
		strText.AppendFormat("%s ~%d", UiFun::UI_LoadString("PROGSTATUS_MODULE"  , "PROGSTATUS_SURPLUS",theApp.gsLanguage ) , pBlockchanged.tips-pBlockchanged.high);
		strText.AppendFormat(" %s",UiFun::UI_LoadString("PROGSTATUS_MODULE"  , "PROGSTATUS_SYNLOCAL",theApp.gsLanguage ));
		m_progress.SetDefinedStr(strText);
		m_bProgressType = TRUE;
		m_nSigIndex =pBlockchanged.connections>3?3:pBlockchanged.connections;

		m_connectCount = pBlockchanged.connections;

		if (pBlockchanged.tips==pBlockchanged.high)
		{
			theApp.IsSyncAppTx = TRUE;             /// 同步app交易
		}

		if ((pBlockchanged.tips-pBlockchanged.high)<10 && !m_walletui)
		{
			TRACE("ok:%s\r\n","OnShowProgressCtrl");
			//// 发送钱包同步完毕
			CPostMsg postblockmsg(MSG_USER_MAIN_UI,WM_UPWALLET);
			theApp.m_MsgQueue.pushFront(postblockmsg); 
			LoadGifing(false);
			m_walletui = true;
			theApp.IsSyncBlock = true;
		}
		Invalidate(); 
		//InvalidateRect(m_bmpsig);
		//		return 1;
	}

	m_nSigIndex = pBlockchanged.connections>3?3:pBlockchanged.connections;
	int  setpos =(int) ((pBlockchanged.high*1.0/pBlockchanged.tips)*100) ;
	setpos = setpos>100?100:setpos;
	//设置进度条的值
	m_progress.SetPos(setpos);
	CString strText;
	strText.AppendFormat("%s ~%d", UiFun::UI_LoadString("PROGSTATUS_MODULE"  , "PROGSTATUS_SURPLUS",theApp.gsLanguage ) , pBlockchanged.tips-pBlockchanged.high);
	strText.AppendFormat(" %s",UiFun::UI_LoadString("PROGSTATUS_MODULE"  , "PROGSTATUS_SYNLOCAL",theApp.gsLanguage ));
	m_progress.SetDefinedStr(strText);
	m_progress.Invalidate();

	if (pBlockchanged.tips==pBlockchanged.high)
	{
		theApp.IsSyncAppTx = TRUE;             /// 同步app交易
	}
	if ((pBlockchanged.tips-pBlockchanged.high)<10&& !m_walletui)
	{
		TRACE("ok:%s\r\n","OnShowProgressCtrl");
		//// 发送钱包同步完毕
		CPostMsg postblockmsg(MSG_USER_MAIN_UI,WM_UPWALLET);
		theApp.m_MsgQueue.pushFront(postblockmsg); 
		LoadGifing(false);
		m_walletui = true;
		theApp.IsSyncBlock = true;
	}
	if ( m_walletui && !m_prosshiden) {
		string strTemp = "";
		strTemp =strprintf("%s%s",netStr , UiFun::UI_LoadString("PROGSTATUS_MODULE"  , "PROGSTATUS_NET",theApp.gsLanguage ) );
		m_strNeting.SetWindowText(strTemp.c_str()) ;
		m_strNeting.ShowWindow(SW_HIDE);
		m_strNeting.ShowWindow(SW_SHOW);

		m_progress.ShowWindow(SW_HIDE);
		if ( NULL != m_ProgressWnd ) {
			m_ProgressWnd->ShowWindow(SW_HIDE) ;
		}
		if (m_prosshiden == false)
		{
			m_prosshiden =true;
		}else{
//.........这里部分代码省略.........
开发者ID:SoyPay,项目名称:DacrsUI,代码行数:101,代码来源:ProgStatusBar.cpp

示例7: Run

void Run()
{
	vector<EndPointData>	vecEndPoint;
	vecEndPoint.reserve(10);
	GetEndPointDeviceData(vecEndPoint);

	{
		std::wstring cmdLine = ::GetCommandLineW();
		if (cmdLine.find(L"-initAllSoundDevice") != std::wstring::npos) {
			for (auto& endPoint : vecEndPoint) {
				if (endPoint.bDefault == false) {
					RegisterDevice(endPoint.devID, eMultimedia);
					::Sleep(1000);
					::PlaySound(_T("mssound.wav"), NULL, SND_FILENAME | SND_SYNC);
					::Sleep(1000);
				}
			}
			for (auto& endPoint : vecEndPoint) {
				if (endPoint.bDefault == true) {
					RegisterDevice(endPoint.devID, eMultimedia);
					break;
				}
			}
			return ;
		}
	}

	// Shift を押しながら起動で デバイス名をクリップボードへコピーする
	if (::GetKeyState(VK_SHIFT) < 0) {
		CString cliptext;
		for (auto it = vecEndPoint.cbegin(); it != vecEndPoint.cend(); ++it)
			cliptext.AppendFormat(_T("%s\r\n"), it->name);
		SetClipboardText(cliptext, NULL);
		return ;
	}

	// コマンドラインからのトグル操作
	std::wregex rx(L"-t\"([^\"]+)\" -t\"([^\"]+)\"");
	std::wsmatch result;
	std::wstring temp = ::GetCommandLineW();
	if (std::regex_search(temp, result, rx)) {
		CString toggleDev1 = result[1].str().c_str();
		CString toggleDev2 = result[2].str().c_str();
		int toggleDevIndex1 = -1;
		int toggleDevIndex2 = -1;
		for (int i = 0; i < static_cast<int>(vecEndPoint.size()); ++i) {
			if (vecEndPoint[i].name.Find(toggleDev1) != -1)
				toggleDevIndex1 = i;
			else if (vecEndPoint[i].name.Find(toggleDev2) != -1)
				toggleDevIndex2 = i;
		}
		if (toggleDevIndex1 != -1 && toggleDevIndex2 != -1) {
			if (vecEndPoint[toggleDevIndex1].bDefault) {	// 1 がデフォルトなら 2 に
				RegisterDevice(vecEndPoint[toggleDevIndex2].devID, eMultimedia);
			} else if (vecEndPoint[toggleDevIndex2].bDefault) {	// 2 がデフォルトなら 1 に
				RegisterDevice(vecEndPoint[toggleDevIndex1].devID, eMultimedia);
			} else {	// それ以外だったら 1 に
				RegisterDevice(vecEndPoint[toggleDevIndex1].devID, eMultimedia);
			}
			return ;
		}
	} else {
		std::wregex rx(L"-t\"([^\"]+)\"");
		std::wsmatch result;
		std::wstring temp = ::GetCommandLineW();
		if (std::regex_search(temp, result, rx)) {
			for (auto& endPoint : vecEndPoint) {
				if (endPoint.name.Find(result.str(1).c_str()) != -1) {
					RegisterDevice(endPoint.devID, eMultimedia);
					return ;
				}
			}
		}
	}

	if (vecEndPoint.size() > 0) {
		HMENU hMenu = ::CreatePopupMenu();
		int nID = 1;
		for (auto it = vecEndPoint.cbegin(); it != vecEndPoint.cend(); ++it) {
			::AppendMenu(hMenu, it->bDefault ? MF_CHECKED : 0, nID, it->name);
			++nID;
		}
		POINT pt;
		::GetCursorPos(&pt);
		HWND hWnd = CreateWindow(_T("STATIC"), _T(""), 0, 0, 0, 0, 0, NULL, NULL, GetModuleHandle(NULL), NULL);
		SetForegroundWindow(hWnd);
		int nCmd = ::TrackPopupMenu(hMenu, TPM_RETURNCMD, pt.x, pt.y, 0, hWnd, NULL);
		if (nCmd) {
			RegisterDevice(vecEndPoint[nCmd - 1].devID, eMultimedia);
		}
	}
}
开发者ID:amate,项目名称:SetDefaultAudioDevice,代码行数:92,代码来源:SetDefaultAudioDevice.cpp

示例8: SetupAdapterInfo

////////////////////////////////////////////////////////////
//	Desc:
//
////////////////////////////////////////////////////////////
BOOL CNetworkAdapter::SetupAdapterInfo( IP_ADAPTER_INFO* pAdaptInfo ) {
	BOOL bSetupPassed				= FALSE;
	IP_ADDR_STRING* pNext			= NULL;
	IP_PER_ADAPTER_INFO* pPerAdapt	= NULL;
	ULONG ulLen						= 0;
	CWinErr err;

	_IPINFO iphold;
	
	if( pAdaptInfo ) {		
#ifndef _UNICODE 
		m_sName			= pAdaptInfo->AdapterName;		
		m_sDesc			= pAdaptInfo->Description;
#else
		USES_CONVERSION;
		m_sName			= A2W( pAdaptInfo->AdapterName );
		m_sDesc			= A2W( pAdaptInfo->Description );
#endif

		m_sPriWins		= pAdaptInfo->PrimaryWinsServer.IpAddress.String;
		m_sSecWins		= pAdaptInfo->SecondaryWinsServer.IpAddress.String;
		m_dwIndex		= pAdaptInfo->Index;		
		m_nAdapterType	= pAdaptInfo->Type;	
		m_bDhcpUsed		= pAdaptInfo->DhcpEnabled;
		m_bWinsUsed		= pAdaptInfo->HaveWins;	
		m_tLeaseObtained= pAdaptInfo->LeaseObtained;
		m_tLeaseExpires	= pAdaptInfo->LeaseExpires;
		m_sDhcpAddr		= pAdaptInfo->DhcpServer.IpAddress.String;

		{
			CString tmpStr;
			for( int pos=0; pos < pAdaptInfo->AddressLength; pos++ )
				tmpStr.AppendFormat( "%02X", pAdaptInfo->Address[pos] );
			m_sMacAddress = tmpStr;
		}
		
		if( pAdaptInfo->CurrentIpAddress ) {
			m_sCurIpAddr.sIp		= pAdaptInfo->CurrentIpAddress->IpAddress.String;
			m_sCurIpAddr.sSubnet	= pAdaptInfo->CurrentIpAddress->IpMask.String;
		}else{
			m_sCurIpAddr.sIp		= _T("0.0.0.0");
			m_sCurIpAddr.sSubnet	= _T("0.0.0.0");
		}


			// since an adapter may have more than one ip address we need
			// to populate the array we have setup with all available
			// ip addresses.
		pNext = &( pAdaptInfo->IpAddressList );
		while( pNext ) {
			iphold.sIp		= pNext->IpAddress.String;
			iphold.sSubnet	= pNext->IpMask.String;
			m_IpAddresses.push_back( iphold );
			pNext = pNext->Next;
		}

			// an adapter usually has just one gateway however the provision exists
			// for more than one so to "play" as nice as possible we allow for it here
			// as well.
		pNext = &( pAdaptInfo->GatewayList );
		while( pNext ) {
			m_GatewayList.push_back( pNext->IpAddress.String );
			pNext = pNext->Next;
		}	
			
			// we need to generate a IP_PER_ADAPTER_INFO structure in order
			// to get the list of dns addresses used by this adapter.
		err = ::GetPerAdapterInfo( m_dwIndex, pPerAdapt, &ulLen );
		if( err == ERROR_BUFFER_OVERFLOW ) {
			pPerAdapt = ( IP_PER_ADAPTER_INFO* ) ALLOCATE_FROM_PROCESS_HEAP( ulLen );
			err = ::GetPerAdapterInfo( m_dwIndex, pPerAdapt, &ulLen );
			
				// if we succeed than we need to drop into our loop
				// and fill the dns array will all available IP
				// addresses.
			if( err == ERROR_SUCCESS ) {
				pNext = &( pPerAdapt->DnsServerList );
				while( pNext ) {
					m_DnsAddresses.push_back( pNext->IpAddress.String );
					pNext = pNext->Next;
				}				
				bSetupPassed = TRUE;
			}

				// this is done outside the err == ERROR_SUCCES just in case. the macro
				// uses NULL pointer checking so it is ok if pPerAdapt was never allocated.
			DEALLOCATE_FROM_PROCESS_HEAP( pPerAdapt );
		}		
	}
	
	return bSetupPassed;
}
开发者ID:prakash028,项目名称:newscaster,代码行数:96,代码来源:netadapter.cpp

示例9: Serialize

void CpokDoc::Serialize(CArchive& ar)
{
	if (ar.IsStoring())
	{
		//  storing code
		CString c = _T("#######  Output of LSystem editor program  ########\r\n#\r\n#\r\n");
		for( int i = 0; i < c.GetLength( ); i++)
			ar << c[ i];

		c.Empty( );
		c = _T("# recursion levels\r\n");
		for( int i = 0; i < c.GetLength( ); i++)
			ar << c[ i];

		c.Empty( );
		for( int i= 0; i < NUM_LVLS; i++)
		{
			c.AppendFormat( "%i-", m_pScene->GetLSystem( )->getRecursionLevel( i) );
		}

		for( int i = 0; i < c.GetLength( )-1; i++)
			ar << c[ i];
			

		c.Empty( );
		c = _T("\r\n# default angle\r\n");
		for( int i = 0; i < c.GetLength( ); i++)
			ar << c[ i];

		c.Empty( );
		c.AppendFormat( "%.3f", m_pScene->GetLSystem( )->getDefaultAngle( ) );
		for( int i = 0; i < c.GetLength( ); i++)
			ar << c[ i];	

		c.Empty( );
		c = _T("\r\n# default thickness\r\n");
		for( int i = 0; i < c.GetLength( ); i++)
			ar << c[ i];

		c.Empty( );
		c.AppendFormat( "%.3f", m_pScene->GetLSystem( )->getDefaultThick( ) );
		for( int i = 0; i < c.GetLength( ); i++)
			ar << c[ i];

		c.Empty( );
		c = _T("\r\n# default lenght\r\n");
		for( int i = 0; i < c.GetLength( ); i++)
			ar << c[ i];

		c.Empty( );
		c.AppendFormat( "%.3f", m_pScene->GetLSystem( )->GetDefaultLenght( ) );
		for( int i = 0; i < c.GetLength( ); i++)
			ar << c[ i];

		c.Empty( );
		c = _T("\r\n# PointSprites Sizes\r\n");
		for( int i = 0; i < c.GetLength( ); i++)
			ar << c[ i];

		c.Empty( );
		c.AppendFormat( "%.3f-%.3f-%.3f-%.3f",
			m_pScene->GetLSystem( )->GetPSSizes( )[ 0],
			m_pScene->GetLSystem( )->GetPSSizes( )[ 1],
			m_pScene->GetLSystem( )->GetPSSizes( )[ 2],
			m_pScene->GetLSystem( )->GetPSSizes( )[ 3]
			);
		for( int i = 0; i < c.GetLength( ); i++)
			ar << c[ i];

		c.Empty( );
		c = _T("\r\n#\r\n# axiom:\r\n");
		for( int i = 0; i < c.GetLength( ); i++)
			ar << c[ i];		

		c.Empty( );
		c = m_pScene->GetLSystem( )->getAxiom( ).c_str( );
		for( int i = 0; i < c.GetLength( ); i++)
			ar << c[ i];		
		

		c.Empty( );
		c = _T("\r\n# rules:\r\n");
		for( int i = 0; i < c.GetLength( ); i++)
			ar << c[ i];

		c.Empty( );
		c = m_pScene->GetLSystem( )->getRulesString( ).c_str( );
		for( int i = 0; i < c.GetLength( ); i++)
			ar << c[ i];
	}
	else
	{
		// reset scene
		m_pScene->Reset( );

		// load the data in the buffer into the LSystem
		if( ! m_pScene->GetLSystem( )->Load( ( char*)( ar.m_strFileName.GetBuffer( ) ) ) )
		{
			AfxMessageBox( _T("Loading of LSystem failed") , MB_OK, 0);
			return;
//.........这里部分代码省略.........
开发者ID:vencax,项目名称:point-sprites-tree-modeling,代码行数:101,代码来源:PokDoc.cpp

示例10:

BOOL COfficeInfo<T_REGISTRY>::_ReloadVisioInfo( int nOfficeVer, const CString& strOfficePath, DWORD dwLang, int nIndex, BOOL bOnlyCheckIfExist /* = FALSE */ )
{
	if ( nIndex < 0 )
	{
		return FALSE;
	}

	CString strFilename;
	if ( 11 == nOfficeVer )
	{
		///> visio2003的installRoot放在与office common中会导致
		///> visio2003先安装时,这个路径会被office改写, 这种情况下,仅支持默认路径安装的visio2003
		///> visio2003后安装时,这个路径会被visio改写,  这种情况下,visio2003可以正常地支持
		
		///> 1、看office2003安装目录的并行目录是否存在
		strFilename = strOfficePath;
		strFilename.TrimRight( _T('\\') );
		int nTrim = strFilename.ReverseFind( _T('\\') );
		if ( -1 != nTrim )
		{
			strFilename = strFilename.Left( nTrim + 1 );
			strFilename += _T("Visio11\\");
			strFilename.AppendFormat( L"%s.exe", _office_products[ nIndex ].szKey2 );

			if ( PathFileExists(strFilename) )
			{
				return bOnlyCheckIfExist ? TRUE : _FoundOfficeProduct( nOfficeVer, _office_products[ nIndex ].nType, dwLang, strFilename );
			}
		}

		strFilename.Empty();


		///> 2、看注册表中写入的installRoot路径的并行目录是否存在
		CString strSubKey;	
		strSubKey = _T("SOFTWARE\\Microsoft\\Office\\11.0\\Common\\InstallRoot");
		if( !m_reg.ReadString( HKEY_LOCAL_MACHINE, strSubKey, _T("Path"), strFilename ) )
			return FALSE;

		strFilename.TrimRight( _T('\\') );
		nTrim = strFilename.ReverseFind( _T('\\') );
		if ( -1 != nTrim )
		{
			strFilename = strFilename.Left( nTrim + 1 );
			strFilename += _T("Visio11\\");
			strFilename.AppendFormat( L"%s.exe", _office_products[ nIndex ].szKey2 );
			if ( PathFileExists(strFilename) )
			{
				return bOnlyCheckIfExist ? TRUE : _FoundOfficeProduct( nOfficeVer, _office_products[ nIndex ].nType, dwLang, strFilename );
			}
		}
		
		return FALSE;
	}
	else
	{
		///> visio2003之后的版本,默认会安装到office的目录

		///> 1、office的安装目录
		strFilename.Format( _T("%s\\%s.exe"), strOfficePath, _office_products[ nIndex ].szKey2 );
		if ( PathFileExists(strFilename) )
		{
			return bOnlyCheckIfExist ? TRUE : _FoundOfficeProduct( nOfficeVer, _office_products[ nIndex ].nType, dwLang, strFilename );
		}

		///> 2、注册表中得出的路径 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\%d.0\Visio\InstallRoot
		CString strSubKey;	
		strFilename.Empty();
		strSubKey.Format( _T("SOFTWARE\\Microsoft\\Office\\%d.0\\Visio\\InstallRoot"), nOfficeVer );
		if( !m_reg.ReadString( HKEY_LOCAL_MACHINE, strSubKey, _T("Path"), strFilename ) )
			return FALSE;

		strFilename.TrimRight( _T('\\') );
		strFilename.AppendFormat( _T("\\%s.exe"), _office_products[ nIndex ].szKey2 );
		if ( PathFileExists(strFilename) )
		{
			return bOnlyCheckIfExist ? TRUE : _FoundOfficeProduct( nOfficeVer, _office_products[ nIndex ].nType, dwLang, strFilename );
		}
	}

	return FALSE;
}
开发者ID:6520874,项目名称:pcmanager,代码行数:82,代码来源:EnvUtils.cpp

示例11: Init

void CSysEnv::Init()
{
	static CThreadGuard	locker;
	autolock<CThreadGuard> _lk(locker);

	lang = GetLangID();
	isAdmin = IsAdministratorUser();
	isWin64 = IsWin64();
	
	static ISoftInfo *pWindowsInfo=NULL;

	m_pOfficeInfo = NULL;
	if(m_arrSofts.GetSize()==0)
	{
		pWindowsInfo = new CWindowsInfo;
		m_arrSofts.Add( pWindowsInfo );
		m_arrSofts.Add( new CInternetExplorer );

		m_arrSofts.Add( new CWSScriptInfo );
		m_arrSofts.Add( new CMediaplayerInfo );
		m_arrSofts.Add( new CDirectXInfo );
		m_arrSofts.Add( new COutLookExpressInfo );
		m_arrSofts.Add( new CDataAccessInfo );

		m_arrSofts.Add( new CDotNetFrameworkInfo );
		m_arrSofts.Add( new CXmlCoreInfo );
	}
	
	for(int i=0; i<m_arrSofts.GetSize(); ++i)
	{
		m_arrSofts[i]->TryReadInfo();
	}
	
	if(pWindowsInfo)
	{
		m_WinVer = pWindowsInfo->m_nVer;
		m_WinSP = pWindowsInfo->m_nSP;
	}

#if 0
	CString strAll;
	// 系统
	static LPCTSTR szTitles[] = {
		_T("Windows"),
		_T("IE"),
		_T("Script"),
		_T("MediaPlayer"),
		_T("DirectX"),
		_T("Outlook"),
		_T("DataAccess"),
		_T("DotFramework"),
		_T("Xml"),
	};
	
	strAll.Format(_T("ISAdmin:%d  IsWin64:%d  Lang:%d\n"), isAdmin?1:0, isWin64?1:0, lang);
	for(int i=0; i<m_arrSofts.GetSize(); ++i)
	{
		strAll.AppendFormat(_T("%s : %d - %d \n"), szTitles[i], m_arrSofts[i]->m_nVer, m_arrSofts[i]->m_nSP);
	}
	MessageBox(NULL, strAll, NULL, MB_OK);
#endif 
}
开发者ID:6520874,项目名称:pcmanager,代码行数:62,代码来源:EnvUtils.cpp

示例12: Update

void CUpdateThread::Update()
{
	// 读取本地配置
	UpdateCommandButton(COMMAND_BUTTON_CANCEL);
	UpdateMainProgress(0);
	UpdateSubProgress(0);

	UpdateStatusText(_T("读取站点列表……"));
	CString strIniPath = theApp.GetProfileFile();
	CString strSites;
	DWORD dwSize = 0;
	do 
	{
		dwSize += 4096;
	} while(GetPrivateProfileSection(_T("Sites"), strSites.GetBuffer(dwSize), dwSize, strIniPath.GetString()) == dwSize - 2);
	UpdateSubProgress(100);

	CArray<CString> sites;
	LPCTSTR lpszSite = strSites.GetBuffer();
	while (lpszSite[0]) 
	{
		sites.Add(lpszSite);
		lpszSite += _tcslen(lpszSite) + 1;
	}
	strSites.ReleaseBuffer();

	UpdateMainProgress(2);

	CMap<CString, LPCTSTR, AddonFile, AddonFile&> files;
	// 下载文件列表
	double step = 6.0 / sites.GetSize();
	for (int i = 0; i < sites.GetSize() && CheckCancel(); ++i) 
	{
		CString &strSite = sites.GetAt(i);
		if (!GetFileList(strSite, files))
		{
			UpdateSubProgress(100);
			UpdateMainProgress(100);
			UpdateStatusText(_T("无法下载文件列表。"));
			return;
		}
		UpdateMainProgress(2 + (int)(step * i + 0.5));
	}
	if (!CheckCancel())
		return;
	UpdateMainProgress(8);
		
	UpdateStatusText(_T("正在检测需要更新的文件……"));

	CString strWOWPath = theApp.GetWOWPath();
	CString strTempPath = theApp.GetTempPath();
	CArray <AddonFile *> aDownloadList;
	// 需要下载的文件
	CMap<CString, LPCTSTR, AddonFile, AddonFile&>::CPair *pair = files.PGetFirstAssoc();
	while (pair && CheckCancel())
	{
		CString strMD5;
		try 
		{
			CString strFilePath;
			strFilePath.Append(strWOWPath);
			strFilePath.Append(pair->value.m_strPath);
			md5_state_t md5;
			md5_init(&md5);
			md5_byte_t digest[16] = {0};
			CFile file(strFilePath, CFile::shareDenyRead | CFile::modeRead);
			char buf[4096];
			UINT nCount;
			while ((nCount = file.Read(buf, 4096)) > 0)
			{
				md5_append(&md5, buf, nCount);	
			}
			file.Close();
			md5_finish(&md5, digest);
			for (int i = 0; i < 16; ++i)
			{
				strMD5.AppendFormat(_T("%02x"), digest[i]);
			}
		}
		catch (CFileException *e)
		{
			e->Delete();
		}
		if (strMD5.Compare(pair->value.m_strMD5) != 0)
		{
			aDownloadList.Add(&pair->value);
		}

		pair = files.PGetNextAssoc(pair);
	}

	if (!CheckCancel())
		return;

	ULONG uTotalSize = 0;
	for (int i = 0; i < aDownloadList.GetSize(); ++i)
	{
		uTotalSize += aDownloadList.GetAt(i)->m_uCompressedSize;
	}

//.........这里部分代码省略.........
开发者ID:wyx1987,项目名称:AddonUpdator,代码行数:101,代码来源:UpdateThread.cpp

示例13: GetItemDisplayText


//.........这里部分代码省略.........
        */
        //Xman only intern
        //if(client->GetFileUploadSocket())
        //	Sbuffer.Format(_T("%s, ready:%u b:%u %u"),CastItoXBytes(client->GetSessionUp(), false, false), client->GetFileUploadSocket()->isready, !client->GetFileUploadSocket()->StandardPacketQueueIsEmpty(),client->GetFileUploadSocket()->blockedsendcount);
        //else
        _tcsncpy(pszText, CastItoXBytes(client->GetSessionUp(), false, false), cchTextMax);
        //Xman end
        break;

    case 4:
        if (client->HasLowID())
            _sntprintf(pszText, cchTextMax, _T("%s (%s)"), CastSecondsToHM(client->GetWaitTime() / 1000), GetResString(IDS_IDLOW));
        else
            _tcsncpy(pszText, CastSecondsToHM(client->GetWaitTime() / 1000), cchTextMax);
        break;

    case 5:
        // ==> Display remaining upload time [Stulle] - Stulle
        /*
        _tcsncpy(pszText, CastSecondsToHM(client->GetUpStartTimeDelay() / 1000), cchTextMax);
        */
        _sntprintf(pszText, cchTextMax, _T("%s (+%s)"), CastSecondsToHM((client->GetUpStartTimeDelay())/1000), client->GetRemainingUploadTime());
        // <== Display remaining upload time [Stulle] - Stulle
        break;

    case 6:
        // ==> PowerShare [ZZ/MorphXT] - Stulle
        /*
        _tcsncpy(pszText, client->GetUploadStateDisplayString(), cchTextMax);
        */
    {
        CString Sbuffer;
        Sbuffer.Format(client->GetUploadStateDisplayString());
        // ==> Display friendslot [Stulle] - Stulle
        if (client->IsFriend() && client->GetFriendSlot())
            Sbuffer.Append(_T(",FS"));
        // <== Display friendslot [Stulle] - Stulle
        // ==> Do not display PowerShare or Fair Play for bad clients [Stulle] - Stulle
        if(client->GetUploadState()==US_BANNED || client->IsGPLEvildoer() || client->IsLeecher())
        {
            _tcsncpy(pszText, Sbuffer, cchTextMax);
            break;
        }
        // <== Do not display PowerShare or Fair Play for bad clients [Stulle] - Stulle
        if (client->GetPowerShared())
            Sbuffer.Append(_T(",PS"));
        // ==> Fair Play [AndCycle/Stulle] - Stulle
        // ==> requpfile optimization [SiRoB] - Stulle
        /*
        const CKnownFile *file = theApp.sharedfiles->GetFileByID(client->GetUploadFileID());
        */
        const CKnownFile *file = client->CheckAndGetReqUpFile();
        // <== requpfile optimization [SiRoB] - Stulle
        if (file && !file->IsPartFile() && file->statistic.GetFairPlay()) {
            Sbuffer.Append(_T(",FairPlay"));
        }
        // <== Fair Play [AndCycle/Stulle] - Stulle
        // ==> Pay Back First [AndCycle/SiRoB/Stulle] - Stulle
        if(client->IsPBFClient()) // client->credits != NULL here
        {
            if (client->IsSecure())
                Sbuffer.Append(_T(",PBF"));
            else
                Sbuffer.Append(_T(",PBF II"));

            Sbuffer.AppendFormat(_T(" (%s)"),CastItoXBytes(client->credits->GetDownloadedTotal()-client->credits->GetUploadedTotal()));
        }
        // <== Pay Back First [AndCycle/SiRoB/Stulle] - Stulle
        _tcsncpy(pszText, Sbuffer, cchTextMax);
    }
        // <== PowerShare [ZZ/MorphXT] - Stulle
    break;

    case 7:
        _tcsncpy(pszText, GetResString(IDS_UPSTATUS), cchTextMax);
        break;

    //Xman version see clientversion in every window
    case 8:
        _tcsncpy(pszText, client->DbgGetFullClientSoftVer(), cchTextMax);
        break;
    //Xman end

    //Xman show complete up/down in uploadlist
    case 9:
        if(client->Credits())
            _sntprintf(pszText, cchTextMax, _T("%s/ %s"), CastItoXBytes(client->credits->GetUploadedTotal()), CastItoXBytes(client->credits->GetDownloadedTotal()));
        else
            _tcsncpy(pszText, _T("?"), cchTextMax);
        break;
    //Xman end

    // ==> Uploading Chunk Detail Display [SiRoB/Fafner] - Stulle
    case 10:
        _tcsncpy(pszText, _T("Chunk Details"), cchTextMax);
        break;
        // <== Uploading Chunk Detail Display [SiRoB/Fafner] - Stulle
    }
    pszText[cchTextMax - 1] = _T('\0');
}
开发者ID:tedlz123,项目名称:EMule-GIFC,代码行数:101,代码来源:UploadListCtrl.cpp

示例14: Instruction

CString Instruction( void )
{
	CString csResult;
	csResult.Format( _T("") );
	///////////////////////////1234567890123456789012345678901234567890123456789012345678901234567890
	csResult.AppendFormat( _T("**********************************************************************\r\n") );
	csResult.AppendFormat( _T("*                                    \u6B22\u8FCE\u4F7F\u7528JHC888007\u8F6F\u4EF6\uFF01                                     *\r\n") );
	csResult.AppendFormat( _T("*                                                                                                             *\r\n") );
	csResult.AppendFormat( _T("*                                             by jhc888007                                              *\r\n") );
	csResult.AppendFormat( _T("*                                        [email protected]                                         *\r\n") );
	csResult.AppendFormat( _T("**********************************************************************\r\n") );
	csResult.AppendFormat( _T("\r\n") );
	csResult.AppendFormat( _T("\u4F7F\u7528\u8BF4\u660E\uFF1A\r\n") );
	csResult.AppendFormat( _T("\u8F93\u5165\uFF1A\u76EE\u5F55\u5FC5\u586B\uFF0C\u4E3A\u9700\u6574\u7406\u4E13\u8F91\u76EE\u5F55\u7684\u7236\u76EE\u5F55\u3002\r\n") );
	csResult.AppendFormat( _T("\u8F93\u5165\uFF1A\u827A\u672F\u5BB6\u9009\u586B\uFF0C\u4E3A\uFF08\u9ED8\u8BA4\uFF09\u827A\u672F\u5BB6\u3002\r\n") );
	csResult.AppendFormat( _T("\u9009\u9879\uFF1A\u9009\u4E2D\u201C\u9501\u5B9A\u201D\uFF0C\u5219\u8BA4\u4E3A\u8F93\u5165\u827A\u672F\u5BB6\u4E3A\u6240\u6709\u4E13\u8F91\u7684\u827A\u672F\u5BB6\uFF08\u5982\u679C\u8F93\u5165\u4E0D\u4E3A\u7A7A\uFF09\u3002\u4E0D\r\n") );
	csResult.AppendFormat( _T("         \u9009\u201C\u9501\u5B9A\u201D\uFF0C\u5219\u8BA4\u4E3A\u8F93\u5165\u827A\u672F\u5BB6\u4E3A\u9ED8\u8BA4\u827A\u672F\u5BB6\uFF0C\u5F53\u7A0B\u5E8F\u4E0D\u80FD\u4ECE\u76EE\u5F55\u540D\u79F0\u83B7\u53D6\u827A\u672F\r\n") );
	csResult.AppendFormat( _T("         \u5BB6\u65F6\u4F7F\u7528\u9ED8\u8BA4\u827A\u672F\u5BB6\u3002\r\n") );
	csResult.AppendFormat( _T("\u9009\u9879\uFF1A\u9009\u4E2D\u201C\u7279\u6B8A\u6A21\u5F0F\u201D\uFF0C\u5219\u8BA4\u4E3A\u6B64\u76EE\u5F55\u4E0B\u6240\u6709\u6587\u4EF6\u90FD\u4E0D\u662F\u97F3\u4E50\u6587\u4EF6\uFF0C\u4EC5\u4EC5\u5C06\u6240\u6709\u6587\u4EF6\r\n") );
	csResult.AppendFormat( _T("         \u547D\u540D\u6574\u7406\u3002\u4E0D\u9009\u201C\u7279\u6B8A\u6A21\u5F0F\u201D\uFF0C\u5219\u4E3A\u666E\u901A\u6A21\u5F0F\u3002\r\n") );
	csResult.AppendFormat( _T("\u4E13\u8F91\u76EE\u5F55\u540D-\u827A\u672F\u5BB6\uFF1A\u5728\u4E0D\u9501\u5B9A\u827A\u672F\u5BB6\u72B6\u6001\uFF0C\u4E13\u8F91\u76EE\u5F55\u540D\u7684\u7B2C\u4E00\u4E2A\u201C-\u201D\u7B26\u53F7\u524D\u662F\u827A\u672F\u5BB6\r\n") );
	csResult.AppendFormat( _T("         \u540D\u3002\r\n") );
	csResult.AppendFormat( _T("\u4E13\u8F91\u76EE\u5F55\u540D-\u53D1\u884C\u5E74\u4EFD\uFF1A\u53D1\u884C\u5E74\u4EFD\u9700\u8981\u4F7F\u7528\u201C()\u201D\u201C[]\u201D\u201C{}\u201D\u62EC\u8D77\u3002\r\n") );
	csResult.AppendFormat( _T("\u4E13\u8F91\u76EE\u5F55\u540D-\u97F3\u4E50\u683C\u5F0F\uFF1A\u5982\u679C\u4E13\u8F91\u76EE\u5F55\u540D\u4E2D\u5305\u542B\u683C\u5F0F\u4FE1\u606F\uFF0C\u5219\u4F7F\u7528\u8BE5\u683C\u5F0F\uFF0C\u5426\u5219\u5219\u4EE5\r\n") );
	csResult.AppendFormat( _T("         \u4E13\u8F91\u5185\u4EFB\u610F\u97F3\u4E50\u6587\u4EF6\u683C\u5F0F\u4E3A\u4E13\u8F91\u683C\u5F0F\u3002\r\n") );
	csResult.AppendFormat( _T("\u4E13\u8F91\u76EE\u5F55\u540D-\u5531\u7247\u7C7B\u578B\uFF1A\u652F\u6301\u201C\u4E13\u8F91\u201D\u201C\u5408\u8F91\u201D\u201CEP\u201D\u4E09\u79CD\u683C\u5F0F\uFF0C\u9ED8\u8BA4\u4E3A\u201C\u4E13\u8F91\u201D\uFF0C\u53E6\u4E24\u79CD\u9700\u8981\r\n") );
	csResult.AppendFormat( _T("         \u5728\u76EE\u5F55\u540D\u4EFB\u610F\u4F4D\u7F6E\u6CE8\u660E\uFF08\u524D\u540E\u4E0D\u4E0E\u5176\u4ED6\u5B57\u6BCD\u6570\u5B57\u76F8\u8FDE\uFF09\u3002\r\n") );
	csResult.AppendFormat( _T("\r\n") );
	csResult.AppendFormat( _T("**********************************************************************") );
	return csResult;
}
开发者ID:jhc888007,项目名称:MagicMusicManage,代码行数:31,代码来源:Instruction.cpp

示例15: BuildInfoString

CString CGitProgressList::BuildInfoString()
{
	CString infotext;
	m_Command->ShowInfo(infotext);

#if 0

	CString temp;
	int added = 0;
	int copied = 0;
	int deleted = 0;
	int restored = 0;
	int reverted = 0;
	int resolved = 0;
	int conflicted = 0;
	int updated = 0;
	int merged = 0;
	int modified = 0;
	int skipped = 0;
	int replaced = 0;

	for (size_t i=0; i<m_arData.size(); ++i)
	{
		const NotificationData * dat = m_arData[i];
		switch (dat->action)
		{
		case svn_wc_notify_add:
		case svn_wc_notify_update_add:
		case svn_wc_notify_commit_added:
			if (dat->bConflictedActionItem)
				++conflicted;
			else
				++added;
			break;
		case svn_wc_notify_copy:
			++copied;
			break;
		case svn_wc_notify_delete:
		case svn_wc_notify_update_delete:
		case svn_wc_notify_commit_deleted:
			++deleted;
			break;
		case svn_wc_notify_restore:
			++restored;
			break;
		case svn_wc_notify_revert:
			++reverted;
			break;
		case svn_wc_notify_resolved:
			++resolved;
			break;
		case svn_wc_notify_update_update:
			if (dat->bConflictedActionItem)
				++conflicted;
			else if ((dat->content_state == svn_wc_notify_state_merged) || (dat->prop_state == svn_wc_notify_state_merged))
				++merged;
			else
				++updated;
			break;
		case svn_wc_notify_commit_modified:
			++modified;
			break;
		case svn_wc_notify_skip:
			++skipped;
			break;
		case svn_wc_notify_commit_replaced:
			++replaced;
			break;
		}
	}
	if (conflicted)
	{
		temp.LoadString(IDS_SVNACTION_CONFLICTED);
		infotext += temp;
		temp.Format(_T(":%d "), conflicted);
		infotext += temp;
	}
	if (skipped)
	{
		temp.LoadString(IDS_SVNACTION_SKIP);
		infotext += temp;
		infotext.AppendFormat(_T(":%d "), skipped);
	}
	if (merged)
	{
		temp.LoadString(IDS_SVNACTION_MERGED);
		infotext += temp;
		infotext.AppendFormat(_T(":%d "), merged);
	}
	if (added)
	{
		temp.LoadString(IDS_SVNACTION_ADD);
		infotext += temp;
		infotext.AppendFormat(_T(":%d "), added);
	}
	if (deleted)
	{
		temp.LoadString(IDS_SVNACTION_DELETE);
		infotext += temp;
		infotext.AppendFormat(_T(":%d "), deleted);
//.........这里部分代码省略.........
开发者ID:AJH16,项目名称:TortoiseGit,代码行数:101,代码来源:GitProgressList.cpp


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