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


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

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


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

示例1: Compare

void CClipCompare::Compare(int leftId, int rightId)
{
	CClip leftClip;
	if(leftClip.LoadFormats(leftId, true))
	{
		CClip rightClip;
		if(rightClip.LoadFormats(rightId, true))
		{
			bool saveW = true;
			bool saveA = true;
			
			if(leftClip.GetUnicodeTextFormat() == _T("") || rightClip.GetUnicodeTextFormat() == _T(""))
			{
				saveW = false;
			}

			if(leftClip.GetCFTextTextFormat() == "" || rightClip.GetCFTextTextFormat() == "")
			{
				saveA = false;
			}

			if(saveW || saveA)
			{
				CString leftFile = SaveToFile(leftId, &leftClip, saveW, saveA);
				CString rightFile = SaveToFile(rightId, &rightClip, saveW, saveA);

				CString path = GetComparePath();

				if(path != _T(""))
				{
					SHELLEXECUTEINFO sei = { sizeof(sei) };
					sei.lpFile = path;
					CString csParam;
					csParam.Format(_T("%s %s"), leftFile, rightFile);
					sei.lpParameters = csParam;
					sei.nShow = SW_NORMAL;

					Log(StrF(_T("Comparing two clips, left Id %d, right Id %d, Path: %s %s"), leftId, rightId, path, csParam));

					if (!ShellExecuteEx(&sei))
					{
					}
				}
				else
				{
					Log(StrF(_T("CClipCompare::Compare, No Valid compare apps, not doing compare")));

					ShellExecute(NULL, _T("open"), _T("http://winmerge.org/"), NULL,NULL, SW_SHOW);
				}
			}
			else	
			{
				Log(StrF(_T("CClipCompare::Compare, did not find valid text for both passed in clips")));
			}
		}
		else
		{
			Log(StrF(_T("CClipCompare::Compare, Failed to load RIGHT clip formats Id: %d"), rightId));
		}
	}
	else
	{
		Log(StrF(_T("CClipCompare::Compare, Failed to load LEFT clip formats Id: %d"), leftId));
	}
}
开发者ID:erdincay,项目名称:ditto-clipboard,代码行数:65,代码来源:ClipCompare.cpp

示例2: DrawClipInTrack

// トラック内の表示範囲内クリップをサーチして描画
int TimelineEditorView::DrawClipInTrack(const CDC& dcDC, TrackDataRect* pTrackDataRect, const int& iHeight, int iClipTotalCount)
{
	//TODO: 毎回全サーチするのではなくてvectorとかに表示範囲のオブジェクトを設定しておいて操作のたびにvectorを更新する
	int iStartFrame = m_pTimelineDataOperator->GetOperatingLeftFrameNumber();
	if (iStartFrame < 0)
	{
		iStartFrame = 0;
	}
	//ClipDataPositionMap mpClipDataMap;
	m_mpClipMap.clear();
	int iClipCount = pTrackDataRect->GetTrackDataInfo()->GetClipDataInRange(iStartFrame, m_pTimelineDataOperator->GetOperatingRightFrameNumber(), m_mpClipMap);
	ClipDataRect* pClipData;
	ClipDataRect* pClipDataLeft;
	pClipDataLeft = nullptr;
	if (iClipCount > 0)
	{
#ifdef _DEBUG
		CString strFrameNumber;
		double dPointX, dPointY;
		HFONT hfDrawFont;
		CreateDrawFont(13, 0, DEFAULT_FONTFACE, hfDrawFont);
#endif
		ClipDataPositionMap::iterator itr = m_mpClipMap.begin();
		while (itr != m_mpClipMap.end())
		{
			pClipData = (*itr).second;
			m_pTimelineDataOperator->CalcClipRectDisplayPoint(static_cast<CRect&>(*pClipData), pClipData, static_cast<CRect>(pTrackDataRect));
			pClipData->SetVert(iHeight);
			pClipData->DrawMyFillRect();
			if (pClipDataLeft != nullptr)
			{
				// トランジション部分塗り替え
				if (pClipData->left < pClipDataLeft->right)
				{
					m_pTransitionRect->CopyRect(pClipData);
					m_pTransitionRect->right = pClipDataLeft->right;
					m_pTransitionRect->SetVert(iHeight);
					m_pTransitionRect->DrawMyFillRect();
					m_pTransitionRect->DrawMyLeftLine();
					m_pTransitionRect->DrawMyRightLine();
					m_pTransitionRect->SetRectEmpty();

				}
				else if (pClipData->left == pClipDataLeft->right)
				{
					pClipDataLeft->DrawMyRightLine();
				}
			}
			pClipDataLeft = pClipData;
			++itr;

#ifdef _DEBUG
			strFrameNumber.Format(_T(" L:%d T:%d R:%d B:%d I:%d O:%d D:%d i:%d o:%d"), pClipData->left, pClipData->top, pClipData->right, pClipData->bottom, pClipData->GetTimelineInPoint(), pClipData->GetTimelineOutPoint(), pClipData->GetDuration(), pClipData->GetInPoint(), pClipData->GetOutPoint());
			ChangeScreenPointToOpenGLPoint(5, 105 + (iClipTotalCount * 15), iHeight, dPointX, dPointY);
			DrawTextOnGL(static_cast<PCTSTR>(pTrackDataRect->GetTrackName() + strFrameNumber), dcDC.GetSafeHdc(), hfDrawFont, BLACKCOLOR_BRUSH_FLOAT,
				static_cast<float>(dPointX), static_cast<float>(dPointY), TIMELINE_DEFAULTZ, 1.0f);
#endif
			++iClipTotalCount;
		}
		m_mpClipMap.clear();
#ifdef _DEBUG
		DeleteObject(hfDrawFont);
#endif
	}
	return iClipTotalCount;
}
开发者ID:mojimen,项目名称:ProtoCommit,代码行数:67,代码来源:TimelineEditorView.cpp

示例3: OnInitDialog

BOOL CPullFetchDlg::OnInitDialog()
{
	CHorizontalResizableStandAloneDialog::OnInitDialog();
	CAppUtils::MarkWindowAsUnpinnable(m_hWnd);

	AddAnchor(IDC_REMOTE_COMBO, TOP_LEFT, TOP_RIGHT);
	AddAnchor(IDC_OTHER, TOP_LEFT,TOP_RIGHT);

	AddAnchor(IDC_REMOTE_BRANCH, TOP_LEFT,TOP_RIGHT);
	AddAnchor(IDC_BUTTON_BROWSE_REF,TOP_RIGHT);

	AddAnchor(IDOK,BOTTOM_RIGHT);
	AddAnchor(IDCANCEL,BOTTOM_RIGHT);
	AddAnchor(IDC_GROUPT_REMOTE,TOP_LEFT,TOP_RIGHT);
	AddAnchor(IDC_GROUP_OPTION,TOP_LEFT,TOP_RIGHT);
	AddAnchor(IDC_PUTTYKEY_AUTOLOAD,BOTTOM_LEFT);
	AddAnchor(IDC_CHECK_PRUNE,BOTTOM_LEFT);
	AddAnchor(IDC_CHECK_REBASE,BOTTOM_LEFT);
	AddAnchor(IDC_REMOTE_MANAGE,BOTTOM_LEFT);
	AddAnchor(IDHELP, BOTTOM_RIGHT);

	AdjustControlSize(IDC_REMOTE_RD);
	AdjustControlSize(IDC_OTHER_RD);
	AdjustControlSize(IDC_CHECK_SQUASH);
	AdjustControlSize(IDC_CHECK_NOCOMMIT);
	AdjustControlSize(IDC_CHECK_NOFF);
	AdjustControlSize(IDC_CHECK_FFONLY);
	AdjustControlSize(IDC_CHECK_FETCHTAGS);
	AdjustControlSize(IDC_PUTTYKEY_AUTOLOAD);
	AdjustControlSize(IDC_CHECK_REBASE);
	AdjustControlSize(IDC_CHECK_PRUNE);

	CString WorkingDir=g_Git.m_CurrentDir;
	WorkingDir.Replace(_T(':'),_T('_'));

	m_RemoteReg = CRegString(CString(_T("Software\\TortoiseGit\\History\\PullRemote\\")+WorkingDir));
	CString regkey;
	regkey.Format(_T("Software\\TortoiseGit\\TortoiseProc\\PullFetch\\%s_%d\\rebase"),WorkingDir,this->m_IsPull);
	m_regRebase=CRegDWORD(regkey,false);
	regkey.Format(_T("Software\\TortoiseGit\\TortoiseProc\\PullFetch\\%s_%d\\ffonly"), WorkingDir, m_IsPull);
	m_regFFonly = CRegDWORD(regkey, false);
	regkey.Format(_T("Software\\TortoiseGit\\TortoiseProc\\PullFetch\\%s_%d\\autoload"),WorkingDir,this->m_IsPull);

	m_regAutoLoadPutty = CRegDWORD(regkey,this->m_bAutoLoad);
	m_bAutoLoad = m_regAutoLoadPutty;

	if(!CAppUtils::IsSSHPutty())
		m_bAutoLoad = false;

	if(m_bAllowRebase)
	{
		this->m_bRebase = m_regRebase;
	}
	else
	{
		GetDlgItem(IDC_CHECK_REBASE)->ShowWindow(SW_HIDE);
		this->m_bRebase = FALSE;
	}

	this->UpdateData(FALSE);

	this->AddOthersToAnchor();

	this->GetDlgItem(IDC_PUTTYKEY_AUTOLOAD)->EnableWindow(m_bAutoLoadEnable);

	CheckRadioButton(IDC_REMOTE_RD,IDC_OTHER_RD,IDC_REMOTE_RD);
	m_Remote.EnableWindow(TRUE);
	m_Other.EnableWindow(FALSE);
	if(!m_IsPull)
	{
		m_RemoteBranch.EnableWindow(FALSE);
		GetDlgItem(IDC_BUTTON_BROWSE_REF)->EnableWindow(FALSE);
	}

	if(m_IsPull)
	{
		GetDlgItem(IDC_CHECK_REBASE)->ShowWindow(SW_HIDE);
		// check tags checkbox and make it a normal checkbox
		m_bFetchTags = 1;
		m_bFFonly = m_regFFonly;
		UpdateData(FALSE);
		::SendMessage(GetDlgItem(IDC_CHECK_FETCHTAGS)->GetSafeHwnd(), BM_SETSTYLE, GetDlgItem(IDC_CHECK_FETCHTAGS)->GetStyle() & ~BS_AUTO3STATE | BS_AUTOCHECKBOX, 0);
		OnBnClickedCheckFfonly();
	}
	else
	{
		this->GetDlgItem(IDC_GROUP_OPTION)->EnableWindow(FALSE);
		this->GetDlgItem(IDC_CHECK_SQUASH)->EnableWindow(FALSE);
		this->GetDlgItem(IDC_CHECK_NOFF)->EnableWindow(FALSE);
		this->GetDlgItem(IDC_CHECK_FFONLY)->EnableWindow(FALSE);
		this->GetDlgItem(IDC_CHECK_NOCOMMIT)->EnableWindow(FALSE);
	}

	if (g_GitAdminDir.IsBareRepo(g_Git.m_CurrentDir))
		this->GetDlgItem(IDC_CHECK_REBASE)->EnableWindow(FALSE);

	m_Other.SetCaseSensitive(TRUE);
	m_Other.SetURLHistory(TRUE);
	m_Other.LoadHistory(_T("Software\\TortoiseGit\\History\\PullURLS"), _T("url"));

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

示例4: OnInitDialog

LRESULT CQuickSetupDlg::OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled){
	TRC(IDC_FTPSETTINGSBUTTON, "Настройки FTP");
	TRC(IDOK, "Продолжить");
	TRC(IDCANCEL, "Отмена");
	TRC(IDC_LOGINLABEL, "Логин:");
	TRC(IDC_PASSWORDLABEL, "Пароль:");
	TRC(IDC_SERVERLABEL, "На какой сервер будем загружать картинки?");
	TRC(IDC_AUTOSTARTUPCHECKBOX, "Запуск программы при старте Windows");
	TRC(IDC_CAPTUREPRINTSCREENCHECKBOX, "Перехватывать нажатия PrintScreen и Alt+PrintScreen");
	TRC(IDC_EXPLORERINTEGRATION, "Добавить пункт в контекстное меню проводника Windows");
	SetWindowText( APPNAME );
	CString titleText;
	titleText.Format(TR("%s - быстрая настройка"), APPNAME );
	SetDlgItemText(IDC_TITLE, titleText );

	CenterWindow();
	hIcon = (HICON)::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDR_MAINFRAME), 
		IMAGE_ICON, ::GetSystemMetrics(SM_CXICON), ::GetSystemMetrics(SM_CYICON), LR_DEFAULTCOLOR);
	SetIcon(hIcon, TRUE);
	hIconSmall = GuiTools::LoadSmallIcon(IDR_MAINFRAME);
	SetIcon(hIconSmall, FALSE);
	serverComboBox_.Attach( GetDlgItem( IDC_SERVERCOMBOBOX ) );

	if ( !Settings.IsPortable ) {
		SendDlgItemMessage( IDC_AUTOSTARTUPCHECKBOX, BM_SETCHECK, BST_CHECKED, 0);
		SendDlgItemMessage( IDC_CAPTUREPRINTSCREENCHECKBOX, BM_SETCHECK, BST_CHECKED, 0);
		SendDlgItemMessage( IDC_EXPLORERINTEGRATION, BM_SETCHECK, BST_CHECKED, 0);
	}
	LogoImage.SubclassWindow(GetDlgItem( IDC_STATICLOGO ) );
	LogoImage.SetWindowPos(0, 0,0, 48, 48, SWP_NOMOVE );
	LogoImage.LoadImage(0, 0, Settings.UseNewIcon ? IDR_ICONMAINNEW : IDR_PNG1, false, GetSysColor(COLOR_BTNFACE));

	HFONT font = GetFont();
	LOGFONT alf;

	bool ok = ::GetObject(font, sizeof(LOGFONT), &alf) == sizeof(LOGFONT);

	if(ok)
	{
		alf.lfWeight = FW_BOLD;

		NewFont=CreateFontIndirect(&alf);

		HDC dc = ::GetDC(0);
		alf.lfHeight  =  - MulDiv(11, GetDeviceCaps(dc, LOGPIXELSY), 72);
		ReleaseDC(dc);
		NewFont = CreateFontIndirect(&alf);
		SendDlgItemMessage(IDC_TITLE,WM_SETFONT,(WPARAM)(HFONT)NewFont,MAKELPARAM(false, 0));
	}
	
	comboBoxImageList_.Create(16,16,ILC_COLOR32 | ILC_MASK,0,6);

	//serverComboBox_.AddItem( _T("<") + CString(TR("Случайный сервер")) + _T(">"), -1, -1, 0, static_cast<LPARAM>( -1 ) );

	HICON hImageIcon = NULL, hFileIcon = NULL;
	int selectedIndex = 0;

	//CUploadEngineData *uploadEngine = _EngineList->byIndex( Settings.getServerID() );
	std::string selectedServerName = "directupload.net" ;
	for( int i = 0; i < _EngineList->count(); i++) {	
		CUploadEngineData * ue = _EngineList->byIndex( i ); 
		if ( ue->Type !=  CUploadEngineData::TypeImageServer && ue->Type !=  CUploadEngineData::TypeFileServer ) {
			continue;
		}
		HICON hImageIcon = _EngineList->getIconForServer(ue->Name);
		int nImageIndex = -1;
		if ( hImageIcon) {
			nImageIndex = comboBoxImageList_.AddIcon( hImageIcon);
		}
		char *serverName = new char[ue->Name.length() + 1];
		lstrcpyA( serverName, ue->Name.c_str() );
		int itemIndex = serverComboBox_.AddItem( Utf8ToWCstring( ue->Name ), nImageIndex, nImageIndex, 1, reinterpret_cast<LPARAM>( serverName ) );
		if ( ue->Name == selectedServerName ){
			selectedIndex = itemIndex;
		}
	}
	serverComboBox_.SetImageList( comboBoxImageList_ );
	serverComboBox_.SetCurSel( selectedIndex );

	doAuthCheckboxChanged();
	
	serverChanged();

	return 1;  
}
开发者ID:vladios13,项目名称:image-uploader,代码行数:85,代码来源:QuickSetupDlg.cpp

示例5: SW_GetConfigData

HRESULT CSignalWatch_CAN::SW_GetConfigData(xmlNodePtr pNodePtr)
{

    // Setting signal watch window placement and column width
    xmlNodePtr pWndPositn = xmlNewNode(nullptr, BAD_CAST DEF_WINDOW_POSITION);
    xmlAddChild(pNodePtr, pWndPositn);

    WINDOWPLACEMENT WndPlace;
    UINT nDebugSize  = 0;
    //BYTE* pbyTemp = (BYTE*)pbyConfigData;
    if ((m_pouSigWnd != nullptr))
    {
        m_pouSigWnd->GetWindowPlacement(&WndPlace);
        //COPY_DATA(pbyTemp, &WndPlace, sizeof (WINDOWPLACEMENT));

        BOOL bIsWndwVisible = m_pouSigWnd->IsWindowVisible();

        CString strWindwVisibility = "";

        strWindwVisibility = xmlUtils::nSetWindowVisibility(WndPlace.showCmd);

        // Writing visibility in to xml
        xmlNodePtr pVisibility = xmlNewChild(pWndPositn, nullptr, BAD_CAST DEF_VISIBILITY, BAD_CAST strWindwVisibility.GetBuffer(strWindwVisibility.GetLength()));
        xmlAddChild(pWndPositn, pVisibility);

        UINT nFlag = WndPlace.flags;

        CString strWindPlcmnt = "";

        strWindPlcmnt = xmlUtils::nSetWindowVisibility(nFlag);

        // Setting window Placement
        xmlNodePtr pWndwVisibility = xmlNewChild(pWndPositn, nullptr, BAD_CAST DEF_WINDOW_PLACEMENT, BAD_CAST strWindPlcmnt.GetBuffer(strWindPlcmnt.GetLength()));
        xmlAddChild(pWndPositn, pWndwVisibility);

        CString strBottomPos = "", strLeftPos = "", strTopPos = "", strRightPos = "";

        strTopPos.Format("%d", WndPlace.rcNormalPosition.top);
        strLeftPos.Format("%d", WndPlace.rcNormalPosition.left);
        strRightPos.Format("%d", WndPlace.rcNormalPosition.right);
        strBottomPos.Format("%d", WndPlace.rcNormalPosition.bottom);

        // Writing co-ordinates of the window in to XML file
        xmlNodePtr pTopPos = xmlNewChild(pWndPositn, nullptr, BAD_CAST DEF_TOP, BAD_CAST strTopPos.GetBuffer(strTopPos.GetLength()));
        xmlAddChild(pWndPositn, pTopPos);

        xmlNodePtr pLeftPos = xmlNewChild(pWndPositn, nullptr, BAD_CAST DEF_Left,BAD_CAST strLeftPos.GetBuffer(strLeftPos.GetLength()));
        xmlAddChild(pWndPositn, pLeftPos);

        xmlNodePtr pRightPos = xmlNewChild(pWndPositn, nullptr, BAD_CAST DEF_Right,BAD_CAST strRightPos.GetBuffer(strRightPos.GetLength()));
        xmlAddChild(pWndPositn, pRightPos);

        xmlNodePtr pBottomPos = xmlNewChild(pWndPositn, nullptr, BAD_CAST DEF_Bottom,BAD_CAST strBottomPos.GetBuffer(strBottomPos.GetLength()));
        xmlAddChild(pWndPositn, pBottomPos);

        // Setting Column width in to the xml file
        xmlNodePtr pColWidthPtr = xmlNewNode(nullptr, BAD_CAST DEF_Columns_Width);
        xmlAddChild(pNodePtr, pColWidthPtr);

        for (UINT i = 0; i < defSW_LIST_COLUMN_COUNT; i++)
        {
            INT nWidth = m_pouSigWnd->m_omSignalList.GetColumnWidth(i);
            CString strWidth = "";
            strWidth.Format("%d", nWidth);

            if(i == 0)
            {
                // Writing message column value in to xml
                xmlNodePtr pMsgClmnPtr = xmlNewChild(pColWidthPtr, nullptr, BAD_CAST DEF_Message_Column, BAD_CAST strWidth.GetBuffer(strWidth.GetLength()));
                xmlAddChild(pColWidthPtr, pMsgClmnPtr);
            }
            if(i == 1)
            {
                // Writing Raw value column value in to xml
                xmlNodePtr pRawValClmn = xmlNewChild(pColWidthPtr, nullptr, BAD_CAST DEF_Raw_Val_Column, BAD_CAST strWidth.GetBuffer(strWidth.GetLength()));
                xmlAddChild(pColWidthPtr, pRawValClmn);
            }
            if(i == 2)
            {
                // Writing Raw value column value in to xml
                xmlNodePtr pPhyalClmn = xmlNewChild(pColWidthPtr, nullptr, BAD_CAST DEF_Physical_Val_Column, BAD_CAST strWidth.GetBuffer(strWidth.GetLength()));
                xmlAddChild(pColWidthPtr, pPhyalClmn);
            }
            if(i == 3)
            {
                // Writing Raw value column value in to xml
                xmlNodePtr pSigValClmn = xmlNewChild(pColWidthPtr, nullptr, BAD_CAST DEF_Signal_Column, BAD_CAST strWidth.GetBuffer(strWidth.GetLength()));
                xmlAddChild(pColWidthPtr, pSigValClmn);
            }
        }
    }
    return S_OK;
}
开发者ID:ETAS-Eder,项目名称:busmaster,代码行数:93,代码来源:SignalWatch_CAN.cpp

示例6: OnBnClickedDemarcatedSucBtn

/********** Calibration a group of data successfully **********/
void RotorDiskDemarcateDialog::OnBnClickedDemarcatedSucBtn()
{
	if (size >= 10 && demarcatedIdx == size)
	{
		AfxMessageBox(IDS_EXCEED_LIMIT, MB_OK | MB_ICONWARNING);
		return;
	}
	UpdateData(TRUE);

	CSingleton *instance = CSingleton::getInstance();
	//TiltDiscData* tdd = &instance->getCurPHM()->tdd;
	
	copyTdd.CommandAngs[demarcatedIdx][1] = (float)/*dyPitch*/convertedPitch;
	copyTdd.CommandAngs[demarcatedIdx][0] = (float)/*dyRoll*/convertedRoll;
	copyTdd.CommandAngs[demarcatedIdx][2] = (float)/*dyCollective*/convertedCollective;

	copyTdd.MeansureAngs[demarcatedIdx][1] = (float)(stPitch / 180.0f * PI);
	copyTdd.MeansureAngs[demarcatedIdx][0] = (float)(stRoll / 180.0f * PI);
	copyTdd.MeansureAngs[demarcatedIdx][2] = (float)(stCollective / 180.0f * PI);

	// Add a row
	if (demarcatedIdx == size) {
		int nItem = addListRow(demarcatedIdx);
		
		CString text;
		text.Format("%.4g", convertedPitch);
		demarcatedResult.SetItemText(nItem, 1, text);
		text.Format("%.4g", convertedRoll);
		demarcatedResult.SetItemText(nItem, 2, text);
		text.Format("%.4g", convertedCollective);
		demarcatedResult.SetItemText(nItem, 3, text);
		text.Format("%.4g", stPitch);
		demarcatedResult.SetItemText(nItem, 4, text);
		text.Format("%.4g", stRoll);
		demarcatedResult.SetItemText(nItem, 5, text);
		text.Format("%.4g", stCollective);
		demarcatedResult.SetItemText(nItem, 6, text);
	} else {
		// Update a row
		int nItem = demarcatedIdx;
		CString text;
		text.Format("%.4g", convertedPitch);
		demarcatedResult.SetItemText(nItem, 1, text);
		text.Format("%.4g", convertedRoll);
		demarcatedResult.SetItemText(nItem, 2, text);
		text.Format("%.4g", convertedCollective);
		demarcatedResult.SetItemText(nItem, 3, text);
		text.Format("%.4g", stPitch);
		demarcatedResult.SetItemText(nItem, 4, text);
		text.Format("%.4g", stRoll);
		demarcatedResult.SetItemText(nItem, 5, text);
		text.Format("%.4g", stCollective);
		demarcatedResult.SetItemText(nItem, 6, text);
	}

	// Clear
	dyPitch = dyRoll = dyCollective = 0.0f;
	stPitch = stRoll = stCollective = 0.0f;

	UpdateData(FALSE);
	
	if (demarcatedIdx < size) {
		// Edit some line
		demarcatedIdx = size;
	} else {
		size++;
		demarcatedIdx = size;
	}
}
开发者ID:dlsyaim,项目名称:gradthes,代码行数:70,代码来源:RotorDiskDemarcateDialog.cpp

示例7: OnInitDialog

BOOL CFileDiffDlg::OnInitDialog()
{
	CResizableStandAloneDialog::OnInitDialog();
	CString temp;

	CString sWindowTitle;
	GetWindowText(sWindowTitle);
	CAppUtils::SetWindowTitle(m_hWnd, g_Git.m_CurrentDir, sWindowTitle);

	this->m_ctrRev1Edit.Init();
	this->m_ctrRev2Edit.Init();

	m_tooltips.Create(this);
	m_tooltips.AddTool(IDC_SWITCHLEFTRIGHT, IDS_FILEDIFF_SWITCHLEFTRIGHT_TT);

	m_cFileList.SetRedraw(false);
	m_cFileList.DeleteAllItems();
	DWORD exStyle = LVS_EX_FULLROWSELECT | LVS_EX_DOUBLEBUFFER | LVS_EX_INFOTIP;
	m_cFileList.SetExtendedStyle(exStyle);

	m_nIconFolder = SYS_IMAGE_LIST().GetDirIconIndex();
	m_cFileList.SetImageList(&SYS_IMAGE_LIST(), LVSIL_SMALL);

	m_SwitchButton.SetImage((HICON)LoadImage(AfxGetResourceHandle(), MAKEINTRESOURCE(IDI_SWITCHLEFTRIGHT), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR));
	m_SwitchButton.Invalidate();

	m_cFilter.SetCancelBitmaps(IDI_CANCELNORMAL, IDI_CANCELPRESSED);
	m_cFilter.SetInfoIcon(IDI_FILTEREDIT);
	temp.LoadString(IDS_FILEDIFF_FILTERCUE);
	temp = _T("   ")+temp;
	m_cFilter.SetCueBanner(temp);
	if (!m_sFilter.IsEmpty())
		m_cFilter.SetWindowText(m_sFilter);

	int c = ((CHeaderCtrl*)(m_cFileList.GetDlgItem(0)))->GetItemCount()-1;
	while (c>=0)
		m_cFileList.DeleteColumn(c--);

	temp.LoadString(IDS_FILEDIFF_FILE);
	m_cFileList.InsertColumn(0, temp);
	temp.LoadString(IDS_FILEDIFF_EXT);
	m_cFileList.InsertColumn(1, temp);
	temp.LoadString(IDS_FILEDIFF_ACTION);
	m_cFileList.InsertColumn(2, temp);

	temp.LoadString(IDS_FILEDIFF_STATADD);
	m_cFileList.InsertColumn(3, temp);
	temp.LoadString(IDS_FILEDIFF_STATDEL);
	m_cFileList.InsertColumn(4, temp);

	int mincol = 0;
	int maxcol = ((CHeaderCtrl*)(m_cFileList.GetDlgItem(0)))->GetItemCount()-1;
	int col;
	for (col = mincol; col <= maxcol; col++)
	{
		m_cFileList.SetColumnWidth(col,LVSCW_AUTOSIZE_USEHEADER);
	}

	m_cFileList.SetRedraw(true);

	AddAnchor(IDC_DIFFSTATIC1, TOP_LEFT, TOP_RIGHT);
	AddAnchor(IDC_SWITCHLEFTRIGHT, TOP_RIGHT);
	AddAnchor(IDC_FIRSTURL, TOP_LEFT, TOP_RIGHT);
	AddAnchor(IDC_REV1BTN, TOP_RIGHT);
	//AddAnchor(IDC_DIFFSTATIC2, TOP_LEFT, TOP_RIGHT);
	AddAnchor(IDC_SECONDURL, TOP_LEFT, TOP_RIGHT);
	AddAnchor(IDC_REV2BTN, TOP_RIGHT);
	AddAnchor(IDC_FILTER, TOP_LEFT, TOP_RIGHT);
	AddAnchor(IDC_FILELIST, TOP_LEFT, BOTTOM_RIGHT);
	AddAnchor(IDC_REV1GROUP,TOP_LEFT,TOP_RIGHT);
	AddAnchor(IDC_REV2GROUP,TOP_LEFT,TOP_RIGHT);
	AddAnchor(IDC_REV1EDIT,TOP_LEFT);
	AddAnchor(IDC_REV2EDIT,TOP_LEFT);

	EnableSaveRestore(_T("FileDiffDlg"));

	if(this->m_strRev1.IsEmpty())
		this->m_ctrRev1Edit.SetWindowText(this->m_rev1.m_CommitHash.ToString());
	else
	{
		if(m_rev1.GetCommit(this->m_strRev1))
		{
			CString msg;
			msg.Format(IDS_PROC_REFINVALID, this->m_strRev1);
			this->m_FileListText += msg;
		}

		this->m_ctrRev1Edit.SetWindowText(m_strRev1);
	}

	if(this->m_strRev2.IsEmpty())
		this->m_ctrRev2Edit.SetWindowText(this->m_rev2.m_CommitHash.ToString());
	else
	{
		if(m_rev2.GetCommit(this->m_strRev2))
		{
			CString msg;
			msg.Format(IDS_PROC_REFINVALID, this->m_strRev2);
			this->m_FileListText += msg;
		}
//.........这里部分代码省略.........
开发者ID:hfeeki,项目名称:TortoiseGit,代码行数:101,代码来源:FileDiffDlg.cpp

示例8: OnCheckFrameIsRetransmission

// 检查接收帧是否为重发帧
BOOL CADCDataRecThread::OnCheckFrameIsRetransmission(unsigned int uiInstrumentNb, unsigned int uiIPAim, unsigned short usDataPointNow)
{
	CString str = _T("");
	unsigned short usLostDataFrameCount = 0;	// 丢失帧计数
	unsigned short usADCDataNb = ReceiveDataSize;	// ADC一帧的数据个数
	unsigned short usDataPointMove = 0;	// 记录指针偏移量
	unsigned short usDataPointNb = 0;
	double dLostRecData[ReceiveDataSize];
	memset(&dLostRecData, SndFrameBufInit, ReceiveDataSize*(sizeof(double)));
	// 接收到的ADC数据不是重发数据
	hash_map<unsigned int, m_structADC>::iterator iter;
	iter = m_oADCLostMap[uiInstrumentNb].find(usDataPointNow);
	if (iter == m_oADCLostMap[uiInstrumentNb].end())
	{
		// 索引中没找到
		if (usDataPointNow > m_usDataPointPrevious[uiInstrumentNb])
		{
			usDataPointMove  = usDataPointNow - m_usDataPointPrevious[uiInstrumentNb];
		}
		else
		{
			usDataPointMove  = ADCFramePointLength + usDataPointNow - m_usDataPointPrevious[uiInstrumentNb];
		}
		if (usDataPointMove/usADCDataNb == 0)
		{
			usLostDataFrameCount = 0;
		}
		else
		{
			usLostDataFrameCount = usDataPointMove/usADCDataNb - 1;
		}
		
		// 有ADC采集数据丢帧则加入ADC数据重发队列
		if (usLostDataFrameCount > 0)
		{
			for (unsigned short m=0; m<usLostDataFrameCount; m++)
			{
//				ProcessMessages();
				m_structADC ADCDataStruct;
				usDataPointNb = (m_usDataPointPrevious[uiInstrumentNb] + (m + 1) * usADCDataNb) % ADCFramePointLength;
				ADCDataStruct.uiDataCount = m_uiADCDataFrameCount[uiInstrumentNb] + m;
				ADCDataStruct.uiRetransmissionNum = 0;
				m_oADCLostMap[uiInstrumentNb].insert(hash_map<unsigned int, m_structADC>::value_type (usDataPointNb, ADCDataStruct)); 
				TRACE(_T("丢失帧指针偏移量为%d"), usDataPointNb);
				if ((m_uiSampleTempNum[uiInstrumentNb] + ReceiveDataSize) > ADCDataTempDataSize)
				{
					CString str = _T("");
					str.Format(_T("采集站%d丢失帧数%d"), uiInstrumentNb, usLostDataFrameCount);
					str += _T("ADC数据处理过程缓冲区大小不够2!");
					AfxMessageBox(str);
				}
				else
				{
					memset(&m_dSampleTemp[uiInstrumentNb][m_uiSampleTempNum[uiInstrumentNb]], SndFrameBufInit, ReceiveDataSize*(sizeof(double)));
					m_uiSampleTempNum[uiInstrumentNb] += ReceiveDataSize;
				}
				if(uiIPAim == m_uiADCGraphIP[uiInstrumentNb])
				{
					m_pOScopeCtrl[uiInstrumentNb]->AppendPoint(dLostRecData, ReceiveDataSize);
				}
			}
			m_uiADCDataFrameCount[uiInstrumentNb] += usLostDataFrameCount;
		}
		m_usDataPointPrevious[uiInstrumentNb] = usDataPointNow;
		return FALSE;
	}
	else
	{
		// 如果为重发数据则ADC应接收数据个数不变 
		m_uiADCDataFrameCount[uiInstrumentNb]--;
		m_uiADCRetransmissionNb = iter->second.uiDataCount;
		m_oADCLostMap[uiInstrumentNb].erase(iter);
		return TRUE;
	}
}
开发者ID:liquanhai,项目名称:cxm-hitech-matrix428,代码行数:76,代码来源:ADCDataRecThread.cpp

示例9: addPanel


//.........这里部分代码省略.........
		pEC->SetReadOnly(TRUE);
#endif  // rde270


/*	ALL THIS WAS FOR CEDIT, NOT CRICHEDIT
	EDITSTREAM es =  pStream->getEditStreamIn();
	long sz = pEC->GetLimitText()-10;
	LPTSTR buff = new char [sz+1];
	ASSERTX(buff);
	long actual;
	(es.pfnCallback)((DWORD)(pStream), (unsigned char*)buff, sz, &actual);
	buff[actual] = '\0';
	CString sOverflowMsg = pStream->getOverflowMsg();
	if(actual > sz - sOverflowMsg.GetLength())
	{
		buff[sz-sOverflowMsg.GetLength()] = '\0';
		CString s = buff;
		s += sOverflowMsg;
		pEC->SetWindowText(s);
	}
	else
		pEC->SetWindowText(buff);


	// make it close
	(es.pfnCallback)((DWORD)(pStream), (unsigned char*)buff, 0, &actual);
	delete buff;
*/

	// make the tab for this item
	TC_ITEM tie;
	tie.mask = TCIF_TEXT |TCIF_PARAM ;
	tie.lParam = (LPARAM)pStream;
	tie.pszText = (LPTSTR)  LPCTSTR(pStream->getDescriptor()->getTabLabel());
	int iconEnum = pStream->getTabIconEnum();
	if(iconEnum>=0)
	{
		tie.mask |= TCIF_IMAGE;
		tie.iImage = iconEnum;
	}

#ifndef rde270
	// save the inserted tab's index (so it can be accessed by knowing the EC).
	int nIndex = m_tabCtrl.InsertItem(99, &tie );
	::SetWindowLong(pEC->GetSafeHwnd(),GWL_USERDATA,nIndex);
	if( -1 == nIndex )
#else   // rde270
	if (-1 == m_tabCtrl.InsertItem(99, &tie ))
#endif  // rde270
	{
		ASSERTX(FALSE);
	}
	else
	{
		//CToolTipCtrl* pTip = new CToolTipCtrl;
		//pTip->Create(this); // <--- or should it be the tab bar?
		//pTip->
		CToolTipCtrl* pTip = m_tabCtrl.GetToolTips();
		ASSERT(pTip);
		CRect r;
		m_tabCtrl.GetItemRect(m_tabCtrl.GetItemCount()-1, &r);
		CString s;
		s.Format(_T("%s"), (LPCTSTR)pStream->getToolTipText());
		pTip->AddTool(&m_tabCtrl, s, &r, id);
	}

#ifndef rde270
	// moved 'StreamIn' here because we want the tab already setup for when we get the
	//  'finished-a-chunk' callback.
	// use the 'AsyncLoadRichEdit' to stream it in [load asynchronously so we don't kill
	//  the UI for minutes (on big files).]
#pragma message("If you subclass CResultStream with something besides CResultStreamFile, this'll break!")
	CResultStreamFile* pStreamFile = (CResultStreamFile*)pStream;
	// ASSERT(pStreamFile->IsKindOf(RUNTIME_CLASS(CResultStreamFile)));
	// this assert is what *should* be, but the various streams are from the processor DLLs
	//  and for some reason IsKindOf doesn't appear to work across DLL boundaries.

	pEC->StreamIn(pStreamFile->getPath(), bSyncStreamIn, CInputDocView::OnStreamInChunkComplete, (DWORD_PTR)this);

	// Set editing flags and limit
	CInputDoc* pDoc = (CInputDoc*) GetDocument();
	if(id==kBasePanelID && pDoc->m_bBaseIsEditable)
	{
		pEC->SetReadOnly(FALSE);
		const long kMaxAddableChars = 2000;
		long l = pEC->GetTextLength() + kMaxAddableChars;
		pEC->LimitText(l);
		pEC->SetEventMask( ENM_KEYEVENTS| ENM_CHANGE );// want to know when the user changes something

		// if the editable file was imported as UTF-16, then we must make it 'modified' so
		//  it'll be saved as UTF-8 before processing (Ample, et al., can deal with UTF-8,
		//  but not UTF-16).
		if(     (pEC->FileEncoding() != eUTF8)
			&&  (pEC->FileEncoding() != eAnsi) )
			GetDocument()->SetModifiedFlag();
	}
	else
		pEC->SetReadOnly(TRUE);
#endif  // rde270
}
开发者ID:StephenMcConnel,项目名称:CarlaLegacy,代码行数:101,代码来源:inputdocview.cpp

示例10: gameAIThread


//.........这里部分代码省略.........
			else
				ai->writeLog(TEXT("检查左上窗口失败"));
			Sleep(200);
		} 
		else 
			ai->writeLog(TEXT("不检查右上窗口"));

		if(ai->script.command == CScript::WALK || ai->script.command == CScript::CHANGE_MAP)
		{
			if(leader->mapWindow->isExists())
			{
				if(ai->isFighting == TRUE)
				{
					ai->isFighting = FALSE;
					++ai->fightTimes;
					isMousePressForWalk = FALSE;
					leader->mapWindow->leftClickCenter();
					//防断线
					ai->fuckingNP();

					notExistsCounter = 0;
					Sleep(200);
					continue;
				}

				mapWindowCheckCount = 0;
				currX = leader->mapWindow->getX();
				currY = leader->mapWindow->getY();
			}
			else
			{
				if(leader->isOffline())
				{
					logTmp.Format(TEXT("执行脚本命令[%d] 下一坐标(%d,%d) 目标坐标(%d,%d) 时断线, 断线前坐标(%d,%d)")
						, ai->script.command, ai->script.x, ai->script.y
						, ai->script.targetX, ai->script.targetY
						, lastX, lastY);
					ai->writeLog(logTmp);
					ai->isAIStart = FALSE;
					break;
				}
				++mapWindowCheckCount;
				
				if(mapWindowCheckCount < 5)
				{
					++notExistsCounter;
					Sleep(1000);
					continue;
				}
			}
		}// Travel
		
		switch(ai->script.command)
		{
		case CScript::CHANGE_MAP:
			if((abs(ai->script.targetX -currX) < 2 && abs(ai->script.targetY - currY) < 2)
			|| (ai->script.targetX == 0 && ai->script.targetY == 0 && 
			(abs(currX - ai->script.x) > 4 || abs(currY - ai->script.y) > 4)))
			{
				hasNextStep = ai->script.nextStep();
				ai->writeLog(TEXT("转图完成"));
				break;
			}
				
		case CScript::WALK:
			if(mapWindowCheckCount > 0)
开发者ID:donilan,项目名称:study,代码行数:67,代码来源:GameAI.cpp

示例11: doFindEnemy

void CGameAI::doFindEnemy()
{
	CCgxMapWindow* pMap = leader->mapWindow;
	int lastX = 0;
	int lastY = 0;
	int endOfNorth = 0;
	int endOfSouth = 0;
	int walkStep = 0;
	BOOL stepFlag = TRUE;
	int currX = 0;
	int currY = 0;
	int notExistCounter = 0;
	BOOL isEndOfWest = FALSE;
	BOOL isPress = FALSE;
	int goodsCounter = 0;
	int nowMinu = 0;
	int failCounter = 0;
	CString logTmp;
	writeLog(TEXT("开始遇敌"));
	//统计
	int fightingCounter = 0;
	int fightingRound = fightRound;
	//end 统计
	while(isAIStart)
	{
		if(pMap->isExists())
		{
			
			if(isFighting == TRUE)
			{
				isFighting = FALSE;
				// 到点重置
				if(!isReseted && resetMinu != 0)
				{
					nowMinu = getMinu();
					TRACE("Now is %d reset minu %d\n", nowMinu, resetMinu);
					if(resetMinu == nowMinu)
					{
						writeLog(TEXT("到达重置时间,重新开始。"));
						script.resetPos();
						script.nextStep();
						isReseted = TRUE;
						break;
					}
				}
				Sleep(300);
				pMap->leftClickCenter();

				//防断线
				fuckingNP();

				notExistCounter = 0;
				Sleep(200);
				++fightingCounter;
				++fightTimes;
				//战斗超过10次才检查物品
				if(fightingCounter > 10)
				{
					checkGoods(&goodsCounter);
					logTmp.Format(TEXT("战斗结束,检查物品有%d个"), goodsCounter);
					writeLog(logTmp);
					TRACE("==================Goods: %d\n", goodsCounter);
					if(goodsCounter == NUMBER_OF_GOODS)
					{
						if(isConfigYes(SCRIPT_CONTROLL, WHEN_FULL_GOODS_STOP_FIND_ENEMY))
						{
							script.resetPos();
							break;
						}
					}
				}
				if(!checkHPAndMP())
				{
					break;
				}
			}
			currX = pMap->getX();
			currY = pMap->getY();

			//防止迷宫重置
			if(script.lastX == currX && script.lastY == currY)
			{
				walkStep = pMap->goNext(0, 1);
				Sleep(walkStep* WALK_INTERVAL);
			}
			if(abs(script.lastX - currX) < 2 && abs(script.lastY - currY) < 2)
			{
				walkStep = pMap->goNext(script.lastX - currX, script.lastY - currY);
				Sleep(walkStep* WALK_INTERVAL);
			}

			// 无限制遇敌
			if(script.x == 0 && script.y == 0)
			{
				if(!isEndOfWest)
				{
					if(lastX == currX)
					{
						isEndOfWest = TRUE;
						lastY = 0;
//.........这里部分代码省略.........
开发者ID:donilan,项目名称:study,代码行数:101,代码来源:GameAI.cpp

示例12: doStartGame

void CGameAI::doStartGame()
{
	int x = 0;
	int y = 0;
	RECT rect;
	DWORD pId = NULL;
	CString logStr;
	HWND ywtHWND = NULL;
	HWND crossGameHWND = NULL;
	//HWND ywtHWND = FindWindow(TEXT("#32770"), NULL);
	TRACE("game hwnd: %d\n", leader->getHWND());
	if(leader->getHWND() != NULL)
		return;
	ywtHWND = FindWindow(NULL, TEXT("\u201c\u6613\u73a9\u901a\u201d\u5a31\u4e50\u5e73\u53f0"));
	if(ywtHWND != INVALID_HANDLE_VALUE)
	{
		TRACE("Doing start the game\n");
		GetWindowThreadProcessId(ywtHWND, &pId);
		EnumWindows(EnumWindowCallBack, (LPARAM)&pId);
		ywtHWND = (HWND)pId;

		ShowWindow(ywtHWND, SW_SHOWNORMAL);
		Sleep(500);
	
		SetForegroundWindow(ywtHWND);
		Sleep(1000);
		CSystem::sendKey(VK_RETURN);
		Sleep(1000);

		if(script.x > 1 && script.x < 10) {
			for(int i = 1; i < script.x; ++i)
			{
				CSystem::sendKey(VK_DOWN);
				Sleep(1000);
			}
		}
		CSystem::sendKey(VK_RETURN);
		Sleep(4000);
		EnumWindows(FindCrossGateWindowsProc4Login, (LPARAM)&crossGameHWND);
		if(crossGameHWND)
		{
			isGameClosed = FALSE;
			leader->setHWND(crossGameHWND);
			SetForegroundWindow(ywtHWND);
			Sleep(500);

			rect.left = 140;
			rect.top = 140;
			rect.right = 170;
			rect.bottom = 154;
			while(leader->getScreen()->colorDeviation(&rect, RGB(99,36,33)) == 0)
			{
				leader->mapWindow->leftClickCenter();
				Sleep(500);
			}

			rect.left = 136;
			rect.top = 172;
			rect.right = 166;
			rect.bottom = 186;
			fuckingMouse();
			while(leader->getScreen()->colorDeviation(&rect, RGB(99,36,33)) == 0)
			{
				CSystem::leftClick(156, 148);
				Sleep(1000);
			}

			rect.left = 142;
			rect.top = 352;
			rect.right = 184;
			rect.bottom = 362;
			logStr.Format(TEXT("正在登录%d线"), script.y);
			writeLog(logStr);
			if(script.y < 1 || script.y > 10)
				script.y = 3;
			fuckingMouse();
			while(leader->getScreen()->colorDeviation(&rect, RGB(255,255,255)) < 4)
			{
				if(script.y < 6)
				{
					x = 156;
					y = 116 + script.y*32;
				}
				else
				{
					x = 255;
					y = 116 + (script.y-5)*32;
				}
				CSystem::leftClick(x, y);
				Sleep(100);
				CSystem::leftClick(x, y);
				Sleep(100);
				CSystem::leftClick(x, y);
				Sleep(1000);
			}
			if(script.targetX != 2)
				CSystem::leftClick(162, 358);
			else
				CSystem::leftClick(480, 358);
			Sleep(8000);
//.........这里部分代码省略.........
开发者ID:donilan,项目名称:study,代码行数:101,代码来源:GameAI.cpp

示例13: updateDisplayedCBError

void FilterCutDialog::updateDisplayedCBError(float value){
	CString a;
	a.Format(_T("%.2f"), value);
	CBError.SetWindowText(a);
}
开发者ID:pigoblock,项目名称:TFYP,代码行数:5,代码来源:FilterCutDialog.cpp

示例14: LoadMistakes

void CDialogMistakes::LoadMistakes(){
	POSITION pos = m_plstMistakes->GetHeadPosition();
	CMistake* pMistake = NULL;
	char* buf = new char[16];
	int nItem = 0;
	CString strMistake;
		
	while (pos !=NULL){
		pMistake = (CMistake*)m_plstMistakes->GetNext(pos);
		if (MistakeInList(pMistake, 0)){
			continue;
		}
		buf = itoa(pMistake->m_Deck.m_nNumPlayed, buf, 10);
		m_listMistakes.InsertItem(nItem = 0, buf);
		GetMistakeType(pMistake, strMistake);
		if (pMistake->m_nMistake < 0){
			m_dBetMistakes += pMistake->m_dLoss;
			m_dTotalMistakes += pMistake->m_dLoss;
			//bet
		}
		else{
			m_dPlayMistakes += pMistake->m_dLoss*pMistake->m_nBet;
			m_dTotalMistakes += pMistake->m_dLoss*pMistake->m_nBet;
			//mistake play
		}
		m_listMistakes.SetItemText(nItem, 1, strMistake);
		strMistake.Format("%.4f", pMistake->m_dLoss);
		m_listMistakes.SetItemText(nItem, 2, strMistake);
		m_listMistakes.SetItemText(nItem, 3, pMistake->m_Date.Format("%m/%d %H:%M"));
		m_listMistakes.SetItemData(nItem, (DWORD)pMistake);
	}
	pos = m_plstStandardMistakes->GetHeadPosition();
	while (pos !=NULL){
		pMistake = (CMistake*)m_plstStandardMistakes->GetNext(pos);
		if (MistakeInList(pMistake, 1)){
			continue;
		}
		buf = itoa(pMistake->m_Deck.m_nNumPlayed, buf, 10);
		m_listStandardMistakes.InsertItem(nItem = 0, buf);
		GetMistakeType(pMistake, strMistake);
		if (pMistake->m_nMistake < 0){
			m_dBetMistakes2 += pMistake->m_dLoss;
			m_dTotalMistakes2 += pMistake->m_dLoss;
			//bet
		}
		else{
			m_dPlayMistakes2 += pMistake->m_dLoss*pMistake->m_nBet;
			m_dTotalMistakes2 += pMistake->m_dLoss*pMistake->m_nBet;
			//mistake play
		}
		m_listStandardMistakes.SetItemText(nItem, 1, strMistake);
		strMistake.Format("%.4f", pMistake->m_dLoss);
		m_listStandardMistakes.SetItemText(nItem, 2, strMistake);
		m_listStandardMistakes.SetItemText(nItem, 3, pMistake->m_Date.Format("%m/%d %H:%M"));
		m_listStandardMistakes.SetItemData(nItem, (DWORD)pMistake);
	}

	UpdatePossible();
	delete buf;

	//update the total mistakes, look at betting mistakes and others seperately.
}
开发者ID:devinjacobson,项目名称:bj,代码行数:62,代码来源:DialogMistakes.cpp

示例15: ExportData

UINT CNav_ExportCustomsDlg::ExportData(LPVOID p)
{
	
	HRESULT hRes;
	Excel::_ApplicationPtr appExcel;
	hRes = appExcel.CreateInstance( _T("Excel.Application"));

	CNav_ExportCustomsDlg *Dialog;
	Dialog = (CNav_ExportCustomsDlg*)p;

	if(Dialog != NULL)
	{
		

		CString sStart, sEnd;
		Dialog->m_EndDate.GetWindowText(sEnd);
		Dialog->m_StartDate.GetWindowText(sStart);

		CString sGTD;
		Dialog->m_EdGTDNUMBER.GetWindowText(sGTD);
		COleDateTime datStart,datEnd, cDate;
		datStart.ParseDateTime(sStart);
		datEnd.ParseDateTime(sEnd);
	
		CString sConnect;
		CString sServer, sDatabase;
		sServer = sReadFromIni(_T("DB"),_T("SERVER"),_T("svbyminssq3"));
		//sWriteToIni(_T("DB"),_T("SERVER"),sServer);
		sDatabase = sReadFromIni(_T("DB"),_T("DATABASE"),_T("SHATE-M-8"));
		//sWriteToIni(_T("DB"),_T("DATABASE"),sDatabase);


		
		Excel::WorkbooksPtr ExcelBooks;
		Excel::_WorkbookPtr ExcelBook;
		Excel::_WorksheetPtr ExcelSheet;
		Excel::RangePtr range;

		
		
		

		VARIANT bTRUE;
		bTRUE.vt = 11;
		bTRUE.boolVal = TRUE;
		appExcel->Visible[0] = FALSE;
		ExcelBook= appExcel->Workbooks->Add();
		ExcelSheet = ExcelBook->Worksheets->Item[1];

		sConnect.Format(_T("DRIVER=SQL Server;SERVER=%s;UID=;WSID=%s;Trusted_Connection=Yes;DATABASE=%s;LANGUAGE=русский"),sServer,GetWinUserName(),sDatabase);
		CDatabase* dBase;
		dBase = NULL;
		try
		{
			dBase = new(CDatabase);
			dBase->SetQueryTimeout(600);
			dBase->OpenEx(sConnect,CDatabase::noOdbcDialog);
			sConnect.Format(_T("EXEC [sp_setapprole] '%s', '%s', 'none', 0, 0"),_T("$ndo$shadow"),_T("FF5EC4E40F67BD4EDF3D04F8B84364DAD0")); 
			dBase->ExecuteSQL(sConnect);
		}
		catch(CDBException *exsept)
		{
			appExcel->Visible[0] = TRUE;
			Dialog->m_stState.SetWindowTextW(exsept->m_strError);
			exsept->Delete();
			if(dBase != NULL)
			{
				if(dBase->IsOpen())
				{
					dBase->Close();
				}
				delete(dBase);
			}
			dBase = NULL;
			Dialog->m_BtOK.ShowWindow(1);
			Dialog->SecondThread = NULL;
			return 0;
		}
		CString sSQL;
		try
		{
			

			CRecordset Query(dBase);
		
			int iField;
			CDBVariant dbValue;
			Dialog->m_stState.SetWindowTextW(_T("Формирование"));
			sGTD = sGTD + _T("'");
			sSQL = _T("select distinct SIH.[Posting Date],(SIL.[TTN Series]+SIL.[TTN Number]) AS TTN,SIL.[Item No_ 2], SIH.[Bill-to Name] ");
			sSQL = sSQL + _T(" from [")+sDatabase;
			sSQL = sSQL + _T("$Sales Invoice Header] as SIH join [");
			sSQL = sSQL + sDatabase;
			sSQL = sSQL + _T("$Sales Invoice Line] as SIL on SIL.[Document No_] = SIH.[No_] and SIL.[No_] is not null and SIL.[No_] <> ''  and SIL.[TTN Series] <> '' and SIL.[TTN Number] <> '' join [");
			sSQL = sSQL + sDatabase;
			sSQL = sSQL + _T("$Custom Declaration Relation] as CDR on CDR.[Item No_] = SIL.[No_] and CDR.[Document Type] = 5 and CDR.[CD No_] = '") + sGTD;
			sSQL = sSQL + _T(" where [Sales Process Type Code] = 'Б/Н_ДОСТАВКА' and Left(CONVERT ( nchar , SIH.[Posting Date], 112),8) >= '")+ datStart.Format(_T("%Y%m%d"))+_T("'");
			sSQL = sSQL + _T(" and Left(CONVERT ( nchar , SIH.[Posting Date], 112),8) <= '")+ datEnd.Format(_T("%Y%m%d"))+_T("'");
			//sSQL = sSQL + _T(" and CDR.[CD No_] = '") + sGTD;

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


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