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


C++ CStringArray::SetAt方法代码示例

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


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

示例1: RearrangeFileArrayWithDoubleFileName

void RearrangeFileArrayWithDoubleFileName(CStringArray &fileArr)
{
	// rearrange of file array( follow the order of number )
	int nArr = fileArr.GetSize();
	CString curFileDir;
	CStringArray newfileArr;
	newfileArr.Copy(fileArr);
	int nLength1 = 0;

	// The number of file length 1
	for ( int i = 0; i < nArr; i++ ) {	
		curFileDir = GetFileName(newfileArr[i]);
		curFileDir = curFileDir.Left(curFileDir.ReverseFind('-'));
		curFileDir = curFileDir.Left(curFileDir.ReverseFind('-'));

		if ( curFileDir.GetLength() == 1 )
			nLength1++;
	}

	// Set file length 1 path to real fileArr
	int q=0;
	for ( int i = 0; i < nArr; i++ ) {
		curFileDir = GetFileName(newfileArr[i]);
		curFileDir = curFileDir.Left(curFileDir.ReverseFind('-'));
		curFileDir = curFileDir.Left(curFileDir.ReverseFind('-'));
		if ( curFileDir.GetLength() == 1 )
		{
			fileArr.SetAt(q,newfileArr[i]);
			q++;
		}
	}

	// Set file length 2 path to real fileArr
	q=0;
	for ( int i = 0; i < nArr; i++ ) {
		curFileDir = GetFileName(newfileArr[i]);
		curFileDir = curFileDir.Left(curFileDir.ReverseFind('-'));
		curFileDir = curFileDir.Left(curFileDir.ReverseFind('-'));
		if ( curFileDir.GetLength() != 1  )
		{
			fileArr.SetAt( nLength1+q, newfileArr[i]);
			q++;
		}
	}
}
开发者ID:yellowcd,项目名称:sMIShop,代码行数:45,代码来源:UtilSH.cpp

示例2: GetLastEditScript

BOOL GetLastEditScript(CStringArray &anArray)
{
	int i;

	anArray.RemoveAll();
	if (!m_bEditScriptValid) return FALSE;

	anArray.SetSize(m_EditScript.GetSize());
	for (i=0; i<m_EditScript.GetSize(); i++) anArray.SetAt(i, m_EditScript.GetAt(i));

	return TRUE;
}
开发者ID:dewhisna,项目名称:m6811dis,代码行数:12,代码来源:funccomp.cpp

示例3: GetLangList

	void CLangManager::GetLangList(CStringArray &langs)
	{

		CMyUtility::GetFileList(langs, _T("langs"));

		for (int i=0; i<langs.GetCount(); ++i)
		{
			CString temp = langs.GetAt(i);
			temp = temp.Left(temp.GetLength() - 4);
			langs.SetAt(i, temp);
		}

	}
开发者ID:harrysun2006,项目名称:ag_Client,代码行数:13,代码来源:LangManager.cpp

示例4: BubbleSort

// 根据宽高排序
void BubbleSort(CStringArray &ca)
{
    int len = ca.GetCount();
    int width1 = 0;
    int height1 = 0;
    int width2 = 0;
    int height2 = 0;
    CString tmp;

    for (int i = 0; i < len; i++)
    {
        for (int j = i; j < len; j++)
        {
            swscanf_s(ca[i].GetBuffer(), _T("%dx%d"), &width1, &height1);
            swscanf_s(ca[j].GetBuffer(), _T("%dx%d"), &width2, &height2);
            if ((width1 > width2) || (width1 == width2 && height1 > height2))
            {
                tmp = ca.GetAt(i);
                ca.SetAt(i, ca.GetAt(j));
                ca.SetAt(j, tmp);
            }
        }
    }
}
开发者ID:ardy30,项目名称:YUVPlayer,代码行数:25,代码来源:SettingDlg.cpp

示例5: Alpha

void Alpha(CStringArray& aszS)
{
    int i=0;
    while(i<aszS.GetSize())
    {
        CString tempS;
        Alpha(aszS[i],tempS);
        if(tempS.IsEmpty())
            aszS.RemoveAt(i);
        else
        {
            aszS.SetAt(i,tempS);
            i++;
        }
    }

}
开发者ID:ngphloc,项目名称:design,代码行数:17,代码来源:Tool.cpp

示例6: OnInitialize

void CLookupForm::OnInitialize()
{
    if(m_isHR)
    {
        SetWindowText(_T("Lookup HRESULT values"));

        m_listCtrl.InsertColumn(0, _T("Name"), LVCFMT_LEFT, 120);
        m_listCtrl.InsertColumn(1, _T("Hex value"), LVCFMT_RIGHT, 80);
        m_listCtrl.InsertColumn(2, _T("Dec value"), LVCFMT_RIGHT, 80);
        m_listCtrl.InsertColumn(3, _T("Message"), LVCFMT_LEFT, 250);

        int i = 0;
        while(GraphStudio::InsertHresultLookup(i, &m_listCtrl)) i++;
    }
    else
    {
        SetWindowText(_T("Lookup GUID values"));

        m_listCtrl.InsertColumn(0, _T("Name"), LVCFMT_LEFT, 160);
        m_listCtrl.InsertColumn(1, _T("Value"), LVCFMT_LEFT, 242);
        m_listCtrl.InsertColumn(2, _T("From"), LVCFMT_LEFT, 80);
        m_listCtrl.InsertColumn(3, _T("Info"), LVCFMT_LEFT, 300);

        int i = 0;
        while(GraphStudio::InsertGuidLookup(i, &m_listCtrl)) i++;
    }

    // Make Item-Data lower for better search (more results)
    int count = m_listCtrl.GetItemCount();
    for(int i=0;i<count;i++)
    {
        CStringArray* arData = (CStringArray*)m_listCtrl.GetItemData(i);
        for(int j=0;j<arData->GetCount();j++)
        {
            CString str = arData->GetAt(j);
            str.MakeLower();
            arData->SetAt(j, str);
        }
    }

    m_listCtrl.SortItems(CompareFunction, (DWORD_PTR)&sortData);

    m_listCtrl.SetExtendedStyle( m_listCtrl.GetExtendedStyle() | LVS_EX_GRIDLINES | LVS_EX_FULLROWSELECT | LVS_EX_LABELTIP );
}
开发者ID:EnigmaIndustries,项目名称:graph-studio-next,代码行数:44,代码来源:LookupForm.cpp

示例7: OnDrawHeader

void CBCGPPlannerPrintMonth::OnDrawHeader (CDC* pDC, const CRect& rectHeader)
{
	ASSERT_VALID (pDC);

	const int dxColumn = m_ViewRects [0].Width ();

	CRect rectDayCaption (rectHeader);
	
	DrawHeader (pDC, rectDayCaption, dxColumn);

	rectDayCaption.right = rectDayCaption.left + dxColumn;

	COleDateTime day 
		(
			GetFirstWeekDay2 (m_Date, CBCGPPlannerManagerCtrl::GetFirstDayOfWeek () + 1)
		);

	const int nEnd = m_bCompressWeekend ? 6 : 7;

	CStringArray sa;
	sa.SetSize (nEnd);

	int iColumn = 0;
	for (iColumn = 0; iColumn < nEnd; iColumn++)
	{
		CString strDate;

		if (IsCompressWeekend () && day.GetDayOfWeek () == 7)
		{
			for (int i = 0; i < 2; i++)
			{
				CString strTemp;
				strTemp.GetBuffer (_MAX_PATH);

				SYSTEMTIME st;
				day.GetAsSystemTime (st);

				::GetDateFormat (LOCALE_USER_DEFAULT, 0, &st, 
					_T("ddd"), (LPTSTR)(LPCTSTR)strTemp, _MAX_PATH);

				strTemp.ReleaseBuffer ();

				strDate += strTemp;

				if (i == 0)
				{
					strDate += _T("/");
				}

				day += COleDateTimeSpan (1, 0, 0, 0);
			}
		}
		else
		{
			strDate.GetBuffer (_MAX_PATH);

			SYSTEMTIME st;
			day.GetAsSystemTime (st);

			::GetDateFormat (LOCALE_USER_DEFAULT, 0, &st, 
				m_strCaptionFormat, (LPTSTR)(LPCTSTR)strDate, _MAX_PATH);

			strDate.ReleaseBuffer ();

			day += COleDateTimeSpan (1, 0, 0, 0);
		}

		sa.SetAt (iColumn, strDate);
	}

	for (iColumn = 0; iColumn < nEnd; iColumn++)
	{
		DrawCaption (pDC, rectDayCaption, sa[iColumn], TRUE, TRUE, m_brGray);
		rectDayCaption.OffsetRect (dxColumn + m_OnePoint.cx, 0);
	}
}
开发者ID:iclosure,项目名称:jframework,代码行数:76,代码来源:BCGPPlannerPrintMonth.cpp

示例8: UpdateFilterControlByCheckRule

// 更新过滤数据
BOOL CDlgCheckRuleFeaName::UpdateFilterControlByCheckRule(const CheckRule &checkRule)
{
	CStringArray arrMdlFilterCheckRule;//模型筛选
	CStringToCStringArray(checkRule.strRuleName, arrMdlFilterCheckRule);
	int nArrSize = (int)arrMdlFilterCheckRule.GetSize();
	if (nArrSize < 3 || arrMdlFilterCheckRule.GetAt(0).CompareNoCase(L"filter") != 0)
	{
		arrMdlFilterCheckRule.SetSize(3);
		arrMdlFilterCheckRule.SetAt(0, L"filter");
		arrMdlFilterCheckRule.SetAt(1, L"parameter");
		arrMdlFilterCheckRule.SetAt(2, L"abc");
	}

	m_cmbFilterCategory.ResetContent();
	m_cmbFilterCategory.AddString(L"模型名");
	m_cmbFilterCategory.AddString(L"公用名称");
	m_cmbFilterCategory.AddString(L"参数");

	m_cmbFilterParaName.ResetContent();

	int ntag = -1;
	CString strCatagory = arrMdlFilterCheckRule.GetAt(1);
	if (strCatagory.CompareNoCase(L"name") == 0)
	{
		ntag = 0;
		m_cmbFilterParaName.EnableWindow(FALSE);
	}
	else if (strCatagory.CompareNoCase(L"common_name") == 0)
	{
		ntag = 1;
		m_cmbFilterParaName.EnableWindow(FALSE);
	}
	else if (strCatagory.CompareNoCase(L"parameter") == 0)
	{
		ntag = 2;
		m_cmbFilterParaName.EnableWindow(TRUE);
		m_strParaParameter = arrMdlFilterCheckRule.GetAt(2);//参数名静态变量赋值
	}
	else
		return TRUE;

	m_cmbFilterCategory.SetCurSel(ntag);

	if (ntag == 2)
	{
		CString strParaContent = arrMdlFilterCheckRule.GetAt(2);
		int nFind = -1;
		for (int i = 0; i < theApp.m_arrMdlParam.GetSize(); i++)
		{
			m_cmbFilterParaName.AddString(theApp.m_arrMdlParam[i]);
			if (strParaContent.CompareNoCase(theApp.m_arrMdlParam[i]) == 0)
			{
				nFind = i;
			}
		}
		if (nFind >= 0)
			m_cmbFilterParaName.SetCurSel(nFind);
		else
			m_cmbFilterParaName.SetWindowText(strParaContent);
	}

	if (arrMdlFilterCheckRule.GetSize() == 3)
		m_strFilterContent = arrMdlFilterCheckRule.GetAt(2);
	else
		m_strFilterContent = arrMdlFilterCheckRule.GetAt(3);

	if (arrMdlFilterCheckRule.GetSize() > 4)
		m_bMdlFilter = _wtoi(arrMdlFilterCheckRule.GetAt(4));
	if (m_bMdlFilter)
	{
		m_cmbFilterCategory.EnableWindow(TRUE);
		int nIndex = m_cmbFilterCategory.GetCurSel();
		if (nIndex == 0)
			m_cmbFilterParaName.EnableWindow(FALSE);
		else if (nIndex == 1)
			m_cmbFilterParaName.EnableWindow(FALSE);
		else
			m_cmbFilterParaName.EnableWindow(TRUE);
		GetDlgItem(IDC_EDIT_MDL_PARA_CATA_CONTENT)->EnableWindow(TRUE);
	}
	else
	{
		m_cmbFilterCategory.EnableWindow(FALSE);
		m_cmbFilterParaName.EnableWindow(FALSE);
		GetDlgItem(IDC_EDIT_MDL_PARA_CATA_CONTENT)->EnableWindow(FALSE);
	}

	UpdateData(FALSE);
	return TRUE;
}
开发者ID:bjliugq,项目名称:SmartDoctor,代码行数:91,代码来源:DlgCheckRuleFeaName.cpp

示例9: CacheItem

void CLibraryDetailView::CacheItem(int nItem)
{
	CLibraryFile* pFile = Library.LookupFile( m_pList[ nItem ].nIndex );
	if ( ! pFile ) return;
	
	LDVITEM* pItem = &m_pList[ nItem ];
	pItem->nCookie = m_nListCookie;
	
	if ( pItem->pText == NULL ) pItem->pText = new CStringArray();
	
	CStringArray* pText = pItem->pText;
	pText->SetSize( m_nStyle == LVS_REPORT ? DETAIL_COLUMNS + m_pColumns.GetCount() : 1 );
	
	CString strName( pFile->m_sName );
	int nDot = strName.ReverseFind( '.' );
	if ( nDot >= 0 ) strName.SetAt( nDot, 0 );
	pText->SetAt( 0, strName );
	
	if ( m_nStyle == LVS_ICON )
	{
		pItem->nIcon = ShellIcons.Get( pFile->m_sName, 32 );
	}
	else
	{
		if ( pFile->m_nIcon16 >= 0 )
			pItem->nIcon = pFile->m_nIcon16;
		else
			pItem->nIcon = pFile->m_nIcon16 = ShellIcons.Get( pFile->m_sName, 16 );
	}
	
	pItem->nState &= LDVI_SELECTED;
	if ( ! pFile->IsShared() ) pItem->nState |= LDVI_PRIVATE;
	if ( ! pFile->m_bSHA1 ) pItem->nState |= LDVI_UNSCANNED;
	if ( pFile->m_bVerify == TS_FALSE ) pItem->nState |= LDVI_UNSAFE;
	
	if ( m_nStyle != LVS_REPORT ) return;
	
	if ( LPCTSTR pszType = _tcsrchr( pFile->m_sName, '.' ) )
		pText->SetAt( 1, pszType + 1 );
	else
		pText->SetAt( 1, _T("") );
	
	pText->SetAt( 2, Settings.SmartVolume( pFile->GetSize(), FALSE ) );
	if ( pFile->m_pFolder != NULL ) pText->SetAt( 3, pFile->m_pFolder->m_sPath );
	
	CString str;
	str.Format( _T("%lu (%lu)"), pFile->m_nHitsToday, pFile->m_nHitsTotal );
	pText->SetAt( 4, str );
	str.Format( _T("%lu (%lu)"), pFile->m_nUploadsToday, pFile->m_nUploadsTotal );
	pText->SetAt( 5, str );
	
	TCHAR szModified[ 64 ];
	SYSTEMTIME pTime;
	
	FileTimeToSystemTime( &pFile->m_pTime, &pTime );
	SystemTimeToTzSpecificLocalTime( NULL, &pTime, &pTime );
	
	GetDateFormat( LOCALE_USER_DEFAULT, 0, &pTime, _T("yyyy-MM-dd"), szModified, 64 );
	_tcscat( szModified, _T(" ") );
	GetTimeFormat( LOCALE_USER_DEFAULT, 0, &pTime, _T("hh:mm tt"), szModified + _tcslen( szModified ), 64 - _tcslen( szModified ) );
	
	pText->SetAt( 6, szModified );
	
	if ( m_pSchema == NULL ) return;
	
	int nColumn = DETAIL_COLUMNS;
	
	BOOL bSource =	pFile->m_pMetadata && m_pSchema->Equals( pFile->m_pSchema ) &&
					m_pSchema->m_sSingular.CompareNoCase( pFile->m_pMetadata->GetName() ) == 0;
	
	for ( POSITION pos = m_pColumns.GetHeadPosition() ; pos ; nColumn++ )
	{
		CSchemaMember* pMember = (CSchemaMember*)m_pColumns.GetNext( pos );
		
		if ( pMember->m_sName.CompareNoCase( _T("SHA1") ) == 0 )
		{
			if ( pFile->m_bSHA1 )
			{
				pText->SetAt( nColumn, CSHA::HashToString( &pFile->m_pSHA1 ) );
			}
			else pText->SetAt( nColumn, _T("") );
		}
		else if ( bSource )
		{
			pText->SetAt( nColumn, pMember->GetValueFrom( pFile->m_pMetadata, NULL, TRUE ) );
		}
		else
		{
			pText->SetAt( nColumn, _T("") );
		}
	}
}
开发者ID:ericfillipe1,项目名称:shareaza-code,代码行数:92,代码来源:CtrlLibraryDetailView.cpp

示例10: CompareFunctions


//.........这里部分代码省略.........
			//		are identical except for the labels:
			if (pFile1->GetPrimaryLabel(pFunction1->GetMainAddress()).CompareNoCase(
					pFile2->GetPrimaryLabel(pFunction2->GetMainAddress())) != 0) Tp = __max(0, Tp - mat);

			// Normalize it:
			nRetVal = Tp/(__max(M,N)*mat);

			// Build Edit Script:
			if (bBuildEditScript) {
				int last_i, last_j;
				int cur_i, cur_j;
				int k_rest;

				if (dbest > 0) {
					m_EditScript.SetSize(dbest);
					k = kbest;
					last_i = M+1;
					last_j = N+1;

/*
printf("\n%s with %s:\n", LPCTSTR(pFunction1->GetMainName()), LPCTSTR(pFunction2->GetMainName()));
*/

					for (d=dbest-1; d>=0; d--) {
						i = __max((R(d, k-1) + 1), __max((R(d, k) + 1), (R(d, k+1))));

/*
printf("(%3ld, %3ld) : %3ld(%5ld), %3ld(%5ld), %3ld(%5ld) :", d, k,
						(R(d, k-1) + 1), (int)Sp((R(d, k-1))*2-k+1, d),
						(R(d, k) + 1), (int)Sp((R(d, k))*2-k, d),
						(R(d, k+1)), (int)Sp((R(d, k+1))*2-k-1, d));

for (j=Rvisitmin[dbest-1]; j<=Rvisitmax[dbest-1]; j++) {
	if (j == k-1) printf("("); else printf(" ");
	if (R(d,j)<0) printf("   "); else printf("%3ld", R(d, j));
	if (j == k+1) printf(")"); else printf(" ");
}
printf("\n");
*/

						j = i-k;

						if (i == (R(d, k-1) + 1)) {
							strTemp.Format("%ld>%ld", i-1, j);
							cur_i = i-1;
							cur_j = j;
							k--;
							k_rest = 1;
						} else {
							if (i == (R(d, k+1))) {
								strTemp.Format("%ld<%ld", i, j-1);
								cur_i = i;
								cur_j = j-1;
								k++;
								k_rest = -1;
							} else {
								// if (i == (R(d, k) + 1))
								strTemp.Format("%ld-%ld", i-1, j-1);
								cur_i = i-1;
								cur_j = j-1;
								// k=k;
								k_rest = 0;
							}
						}
						m_EditScript.SetAt(d, strTemp);
						// The following test is needed since our insertion/deletion indexes are
						//		one greater than the stored i and/or j values from the R matrix.
						//		It is possible that the previous comparison added some extra
						//		entries to the R matrix than what was really needed.  This will
						//		cause extra erroneous entries to appear in the edit script.
						//		However, since the indexes should be always increasing, we simply
						//		filter out extra entries added to the end that don't satisfy
						//		this condition:
						if ((k_rest == 0) &&
							((cur_i == last_i) && (cur_j == last_j))) {
							m_EditScript.RemoveAt(d);
						}

						last_i = cur_i;
						last_j = cur_j;
					}
				}


				// Note: if the two are identical, array stays empty:
				m_bEditScriptValid = TRUE;
			}

			// Deallocate Memory:
			delete[] T;
			delete[] Rvisitmin;
			delete[] Rvisitmax;
			for (i=0; i<dmax; i++) delete[] (Rm[i]);
			delete[] Rm;
		}
		break;
	}

	return nRetVal;
}
开发者ID:dewhisna,项目名称:m6811dis,代码行数:101,代码来源:funccomp.cpp

示例11: startRprCmdTsk

extern "C" _declspec(dllexport) BOOL startRprCmdTsk(CString strNT, _ConnectionPtr ptrCon, char* strCd, char* strPthOt, char* strAc, WCHAR* strNZ){

//	HINSTANCE hInstResClnt;
//	hInstResClnt = AfxGetResourceHandle();
//AfxMessageBox(_T("startRprCmdTsk"));
	AfxSetResourceHandle(::GetModuleHandle("RprCmdTsk.dll"));

//	char* sANZ;
	CStringArray strANZ;
	strANZ.SetSize(1);
	for(int n=0;n<1;n++){
		strANZ.SetAt(n,_T(""));
	}

	CString curStr,strTmp,m_strNZ;
	CString strCod,strAcc,strPathOut;

	m_strNZ    = _T("");
	strCod	   = strCd;
	strCod.TrimLeft();
	strCod.TrimRight();

	strPathOut = strPthOt;
	strPathOut.TrimLeft();
	strPathOut.TrimRight();

	strAcc     = strAc;
	strAcc.TrimLeft();
	strAcc.TrimRight();

	CString strCur,strSql,strCSls;
	CString m_strNT;
	CString m_strCR;	 		//Код грузополучателя
	CString m_strCRAdr;			//Код адреса доставки
	CString m_strCSA;	 		//Код расч.сч. продовца
	CString m_strCREm;			//Код e-mail

//	bPrint =false;
//CCmdTarget c;
//c.BeginWaitCursor();

	_variant_t m_vNULL;
	_RecordsetPtr ptrRs1;
	_CommandPtr ptrCmd1;
	_ConnectionPtr ptrCnn;

	COleVariant vC;
	CBlokRtf m_Blk;
	CWords m_W;

	ptrCnn    = ptrCon;	//Соединение

	CRecSetProc* pR=NULL;
	CString m_strNum,m_strDate,m_strDecDate,sEnd,strCopy;
	CString s,sPrv,m_strNumDec,strSls;

	CString m_strWe1,m_strWe2,m_strInd,m_strOKOHX,m_strOKOH;
	CString m_strVnd,m_strIndVnd,m_strOKOHXV,m_strOKOHV;

//	CString m_strBN;
//	char* m_bsConn;

	int k=0;							//Число складов для наряд заданий
	bool m_bBN;
	int iFind,iNum,i;
										//  № нак
	iFind=strCod.Find('~');
	m_strNum  = strCod.Left(iFind);
	m_strNumDec = m_strNum;
										//  дата
	iNum = strCod.Find('~',iFind+1);
	m_strDecDate = strCod.Mid(iFind+1,iNum-iFind-1);
	iFind = iNum;
										//  код продовца
	iNum = strCod.Find('~',iFind+1);
	strSls = strCod.Mid(iFind+1,iNum-iFind-1);
	iFind = iNum;
		
	iFind   = strCod.ReverseFind('~');
	m_strDate = strCod.Mid(iFind+1);

	m_strNT  = strNT;

// Имена исходящих файлов
	CString strFlNmCmdTsk;
	CString strPath;
	
	strPath =  _T(""); //_T("D:\\MyProjects\\Strg\\Debug\\"); 
	s = m_strDate;
	s.Remove('-');

//AfxMessageBox(strAcc);
	iFind=strAcc.Find('~');				// код грузополучателя
	m_strCR  = strAcc.Left(iFind);

	iNum = strAcc.Find('~',iFind+1);	// Код адреса доставки
	m_strCRAdr = strAcc.Mid(iFind+1,iNum-iFind-1);
	iFind = iNum;

	iNum = strAcc.Find('~',iFind+1);	// Код расч.сч. продовца
//.........这里部分代码省略.........
开发者ID:03bekjob,项目名称:Strg,代码行数:101,代码来源:RprCmdTsk.cpp

示例12: startRprBill


//.........这里部分代码省略.........

			i = 9;		//Код продовца
			vC=pR->GetValueRec(ptrRs1,i);
			vC.ChangeType(VT_BSTR);
			strSls = vC.bstrVal;
			strSls.TrimLeft();
			strSls.TrimRight();

			i = 8;		//Код покупателя
			vC=pR->GetValueRec(ptrRs1,i);
			vC.ChangeType(VT_BSTR);
			strCst = vC.bstrVal;
			strCst.TrimLeft();
			strCst.TrimRight();
		}
	}
	catch(_com_error& e){
		AfxMessageBox(e.ErrorMessage());
		if(ptrRs1->State==adStateOpen) ptrRs1->Close();
		ptrRs1=NULL;
		if(ptrRs2->State==adStateOpen) ptrRs2->Close();
		ptrRs2=NULL;
		if(ptrRs3->State==adStateOpen) ptrRs3->Close();
		ptrRs3=NULL;
		if(ptrRs4->State==adStateOpen) ptrRs4->Close();
		ptrRs4=NULL;
		return FALSE;
	}

	CStringArray aHd;
	int iRpl = 25;	//  строки которые будут меняться (на 1 больше)
	aHd.SetSize(iRpl);
	for(i=0;i<iRpl;i++){
		aHd.SetAt(i,_T(""));
	}
	CString m_strSls;
/*----------------------------- ПРОДАВЕЦ-----------------------*/
/*	bsCmd = _T("RT38Sls "); 
	bsCmd+= (_bstr_t)strSls +_T(",");
	bsCmd+= _T("2,");		// Юридический адрес
	bsCmd+= (_bstr_t)strAcc;
*/
	strSql = _T("RT38Sls_1 ");		//Мы RT38Sls
	strSql+= strSls + _T(",2,");	//Юр адрес - 2
	strSql+= m_strCSA;				//Код расч.сч. продовца

	ptrCmd2->CommandText = (_bstr_t)strSql;
//AfxMessageBox(strSql);
	try{
		//---------------------------------------Про Продовца
		if(ptrRs2->State==adStateOpen) ptrRs2->Close();
		ptrRs2->Open(m_vNULL,m_vNULL,adOpenDynamic,adLockOptimistic,adCmdText);
		if(!pR->IsEmptyRec(ptrRs2))	{
			i=1;
			vC=pR->GetValueRec(ptrRs2,i);
			vC.ChangeType(VT_BSTR);
			m_strSls = vC.bstrVal;
			m_strSls.TrimLeft();
			m_strSls.TrimRight();
			m_strSls+= _T(" ");

			i=2;
			vC=pR->GetValueRec(ptrRs2,i);
			vC.ChangeType(VT_BSTR);
			s = vC.bstrVal;
			s.TrimLeft();
开发者ID:03bekjob,项目名称:Strg,代码行数:67,代码来源:RprBill.cpp

示例13: RuleConvertor

// 版本转换
BOOL CCheckRuleXMLParse::RuleConvertor(int nRuleType, const CString &strRuleContent, CStringArray& arrRuleContent)
{
	if (strRuleContent.IsEmpty())
		return FALSE;

	int nIndex = -1;
	CString strTemp;
	switch (nRuleType)
	{
	// 第1类:规则参数内部无空格,按照空格拆分
	case CRT_MDL_NAME:
	case CRT_FEA_NAME:
	case CRT_PARA:
	case CRT_TOL:
	case CRT_APPEARANCE:
	case CRT_MDL_COMMON_NAME:
	case CRT_QUALITY:
	case CRT_ASS_FAM_INSTNAME:
	case CRT_ASS_FAM_INSTPARAVALID:
	case CRT_ROUND_RAD:
	case CRT_CHAMFER_DIM:
	case CRT_HOLE_PART_EDGE_DIS:
	case CRT_DRW_SHEET_TEXT_SIZE:
	case CRT_DRW_DIM_TEXT_STYLE:
	case CRT_DRW_NOTE_TEXT_STYLE:
		CStringToCStringArray(strRuleContent, arrRuleContent);
		break;
	// 第2类:规则参数只有1个,直接赋值
	case CRT_MAT:
	case CRT_MDL_MATDENS:
	case CRT_ASS_FEA_FOR_LAST:
	case CRT_ASS_MDL_CMD:
	case CRT_CHAMFER_ANG:
	case CRT_SHELL_THICKNESS:
	case CRT_DRAFT_ANGLE:
	case CRT_DEEP_HOLE:
	case CRT_HOLE_DIS:
	case CRT_HOLE_AXIS_IN_MATERIAL:
	case CRT_LONG_AXIS:
	case CRT_AXIS_SHOULDER_ANG:
	case CRT_PART_MAX_SIZE:
	case CRT_FEA_MIN_SIZE:
	case CRT_DEEP_FILLET:
	case CRT_DRW_SHEET_SIZE:
	case CRT_DRW_SHEET_ANGLE:
	case CRT_DRW_SHEET_TEXT_FONT:
	case CRT_DRW_SHEET_SCALE:
		arrRuleContent.SetSize(1);
		arrRuleContent.SetAt(0, strRuleContent);
		break;
	// 第3类:特殊
	case CRT_UNIT:
		CStringToCStringArray(strRuleContent, arrRuleContent, L"#");
		break;
	case CRT_HOLE_DIA:
		nIndex = strRuleContent.Find(L" ");
		if (nIndex >= 0 )
		{
			strTemp = strRuleContent.Left(nIndex);
			if (!strTemp.IsEmpty())
			{
				arrRuleContent.SetSize(2);
				arrRuleContent.SetAt(0, strTemp);
				strTemp = strRuleContent.Mid(nIndex + 1);
				arrRuleContent.SetAt(1, strTemp);
			}
		}
		break;
	default:
		break;
	}
	return TRUE;
}
开发者ID:bjliugq,项目名称:SmartDoctor,代码行数:74,代码来源:CheckRuleXMLParse.cpp


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