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


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

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


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

示例1: OnInitDialog

BOOL CChannelDatabaseAssociationDlg::OnInitDialog()
{
    CDialog::OnInitDialog();

	LVCOLUMN lvColumn;
	LVITEM lvItem;
	BYTE byCol;
	BYTE byItem;

	m_channelDatabaseAssociationListCtrl.SetExtendedStyle( LVS_EX_FULLROWSELECT );

	lvColumn.mask = LVCF_FMT | LVCF_TEXT | LVCF_WIDTH;
	lvColumn.fmt = LVCFMT_LEFT;
	lvColumn.cx = 55;
	lvColumn.pszText = "Channel";
	byCol = (BYTE)m_channelDatabaseAssociationListCtrl.InsertColumn(0, &lvColumn);

	lvColumn.cx = 567;
	lvColumn.pszText = "Database";
	byCol = (BYTE)m_channelDatabaseAssociationListCtrl.InsertColumn(1, &lvColumn);

	lvItem.mask = LVIF_TEXT;
	lvItem.iSubItem = 0;

    CStringArray aomstrTempDBFiles;
    CStringArray aomstrTempChannels;
    (*(CMsgSignal**)(m_sDbParams.m_ppvImportedDBs))->vGetDataBaseNames(&aomstrTempDBFiles);
    (*(CMsgSignal**)(m_sDbParams.m_ppvImportedDBs))->vGetDatabaseChannels(&aomstrTempChannels);

	for(INT i = 1; i <= m_iNumberOfActiveChannels; i++)
	{
		CString tmpChannelNumber;
		tmpChannelNumber.Format("CAN%d", i);			// Format the Bus-Name and Channel-Number
		lvItem.pszText = tmpChannelNumber.GetBuffer(0);	// Convert to LPSTR
		tmpChannelNumber.ReleaseBuffer();				// Release the buffer directly

		lvItem.iItem = i;								// item-position in table

		byItem = (BYTE)m_channelDatabaseAssociationListCtrl.InsertItem(&lvItem);	// insert the new item
	}

    for(INT i = 0; i < m_iNumberOfActiveChannels; i++)
    {
        if(i > aomstrTempChannels.GetUpperBound())
        {
            break;
        }
        int j = atoi(aomstrTempChannels[i]);
        m_channelDatabaseAssociationListCtrl.SetItemText(atoi(aomstrTempChannels[i]) - 1, 1, aomstrTempDBFiles[i]);
    }



    return TRUE;  // return TRUE unless you set the focus to a control
    // EXCEPTION: OCX Property Pages should return FALSE
}
开发者ID:GT-Derka,项目名称:busmaster,代码行数:56,代码来源:DatabaseAssociateDlg.cpp

示例2: PatternFilter

inline BOOL CMyIENSHandle::PatternFilter(CString & url)
{
	CString str, tmp, tmp2;

	try{

	int i = 0, i2=0, start = 0, start2 = 0;//start - str, start2 - tmp
	BOOL cmode = TRUE; //compare mode;
	BOOL isame = FALSE;
	BOOL final = FALSE;
	int p = 0;
	while(p<=aUrlPattern.GetUpperBound() && !isame)
	{
		str = aUrlPattern.GetAt(p);
		//star filter
		i = 0; i2 = 0; start = 0; start2 = 0;
		isame = TRUE;cmode = TRUE;final = FALSE;
		while(start<str.GetLength() && isame)
		{
			//get the string before *
			i=str.Find('*', start);
			if(i<0)
			{
				tmp2 = str.Mid(start);
				i=str.GetLength();
				final = TRUE;
			}
			else
				tmp2 = str.Mid(start,i-start);
			if(tmp2!="")
			{
				if(cmode)
				{
					tmp = url.Mid(start2, i-start);
					if(tmp != tmp2)
						isame = FALSE;
				}
				else if(final)
				{
					tmp = url.Right(tmp2.GetLength());
					if(tmp != tmp2)
						isame = FALSE;
				}
				else
				{
					i2=url.Find(tmp2, start2);
					if( i2<0)
						isame = FALSE;
				}
			}
开发者ID:vicentdsmin,项目名称:myie,代码行数:50,代码来源:MyIENSHandle.cpp

示例3: OnSetActive

BOOL COptionsDlg::OnSetActive() {
	CSnmp *pSnmp = &theApp.m_wnd.snmp;
	if (pSnmp != NULL) {
		CStringArray s;
		CUIntArray nAdapterArray;
		pSnmp->GetInterfaceDescriptions(&s, &nAdapterArray);
		m_Interfaces.ResetContent();
		
		int active = 0;
		for (int i = 0; i <= s.GetUpperBound(); i++) {
			int index = m_Interfaces.AddString(s.GetAt(i));
			if (index != CB_ERR) {
				m_Interfaces.SetItemData(index, nAdapterArray.GetAt(i));
				if (nAdapterArray.GetAt(i) == g_dwAdapter)
					active = i;
			}
		}
		m_Interfaces.SetCurSel(active);
	}
	return CPropertyPage::OnSetActive();
}
开发者ID:nayuki,项目名称:NetPerSec,代码行数:21,代码来源:OptionsDlg.cpp

示例4: Sample_PrepareAcquire


//.........这里部分代码省略.........
			{
				_T("Instrument/Pump/InitFLow")
			};
			for(int i=0; i<sizeof(vs)/sizeof(LPCTSTR); ++i)
			{
				if(adSample.CompareValue_Double(sp + vs[i], ad, vs[i]) != CAnalysisData::CR_EQUAL) notequal.Add(vs[i]);
			}

			static LPCTSTR vs2[] =
			{
				_T("Instrument/Detector/Temp"),
				_T("Instrument/Detector/YZQDL")/*,
											   _T("Instrument/Detector/Range")//*/
			};
			for(int i=0; i<sizeof(vs2)/sizeof(LPCTSTR); ++i)
			{
				if(adSample.CompareValue_Double(sp + vs2[i], ad, vs2[i]) != CAnalysisData::CR_EQUAL) notequal.Add(vs2[i]);
			}

			static LPCTSTR vs3[] =
			{
				_T("Instrument/ColumnBox/Temp")
			};
			for(int i=0; i<sizeof(vs3)/sizeof(LPCTSTR); ++i)
			{
				if(adSample.CompareValue_Double(sp + vs3[i], ad, vs3[i]) != CAnalysisData::CR_EQUAL) notequal.Add(vs3[i]);
			}
		}
		if(!notequal.IsEmpty())
		{
			CString name, sv, cv, tr;
			// 弹出不同对话框
			CString msg(_T("<table border='1'><tr><td>名称</td><td>样品参值</td><td>当前参值</td></tr>"));
			for(int i=0; i<=notequal.GetUpperBound(); ++i)
			{
				const CString& si = notequal.GetAt(i);
				adSample.GetProperty(sp + si, XMLPROP_NAME, name);
				adSample.GetValue_String(sp + si, sv);
				if((ad.GetValue_String(si, cv) != IAERROR_SUCCESS) || cv.IsEmpty()) cv = _T("&nbsp;");
				if((g_cConfigIni.CurrentSystemName().Compare(PASYSTEM_NAME_IC1800) == 0) && (si == _T("Instrument/Detector/Temp")))
				{
					if(sv == _T("0")) sv = _T("40℃");
					else if(sv == _T("1")) sv = _T("50℃");
					else if(sv == _T("2")) sv = _T("60℃");
					else sv = _T("参数错误");

					if(cv == _T("0")) cv = _T("40℃");
					else if(cv == _T("1")) cv = _T("50℃");
					else if(cv == _T("2")) cv = _T("60℃");
					else cv = _T("参数错误");
				}
				tr.Format(_T("<tr><td>%s</td><td>%s</td><td>%s</td></tr>"), name, sv, cv);
				msg += tr;
			}
			msg += _T("</table>");
			switch(HTMLMessageBox(NULL, msg, _T("当前设置参数与样品中的仪器参数不一致"), _T("采用样品中的仪器参数;采用当前设置参数;取消"), _T(";"), ICON_QUESTION))
			{
			case 0:
				// 采用样品中的仪器参数
				if(adSample.GetValue_XMLString(XMLPATH_SAMPLE_PARAM_INSTRUMENT, xmlString) != IAERROR_SUCCESS) return IAERROR_CG_SAMPLE_NOTREADY;
				if(pcInstru->Base_DownloadToDevice(xmlString) != IAERROR_SUCCESS) return IAERROR_CG_SAMPLE_NOTREADY;
				break;
			case 1:break;
			default://取消或X
				return IAERROR_CG_SAMPLE_NOTREADY;
			}
开发者ID:Wanghuaichen,项目名称:SignalProcess,代码行数:67,代码来源:Base_AnalysisTemplate.cpp

示例5: GetColumnStrings

void CWHTable::GetColumnStrings(CStringArray& csStrings, BOOL fKillUnsupportedTypes)
{
	// Retrieve the strings in the current column.
	// Keep finding strings until an 'end choice' token is found.
	int nIndex = m_nIndex;
	int nTableItems = m_csaLine.GetUpperBound();
	int nFound = 0;
	while (nIndex < nTableItems)
	{
		// Find the next non empty string in the column
		while (m_csaLine[nIndex].IsEmpty())
		{
			IncrementRow(nIndex);
			if (nIndex > nTableItems)
				break;
		}

		// Add the non empty string to the array
		if (nIndex <= nTableItems)
		{
			// Add string
			BOOL f = AddFoundString(csStrings, nIndex);
			nFound++;

			// Check for an unsupported type
			if (fKillUnsupportedTypes && nFound > m_nTitleStrings)
			{
				int nLastIndex = csStrings.GetUpperBound();
				CString cs = csStrings[nLastIndex];

				// Search for a token
				int nBang = cs.Find(m_cListEnd);
				if (nBang != -1)
				{
					CString csProjType = cs.Right(cs.GetLength() - (nBang+1));
					int nProjType = atoi((const char*)csProjType);

					// Take off the project type info
					cs = cs.Left(nBang);
					csStrings[nLastIndex] = cs;

					// See if the project type is supported
					CPmwApp* pApp = GET_PMWAPP();
					CPmwDocTemplate* pTemplate = NULL;
					POSITION pos = pApp->GetFirstDocTemplatePosition();

					while (pos != NULL)
					{
						CPmwDocTemplate* pThisTemplate = (CPmwDocTemplate*)pApp->GetNextDocTemplate(pos);
						if (pThisTemplate->ProjectType() == nProjType)
						{
							pTemplate = pThisTemplate;
							break;
						}
					}

					if (pTemplate == NULL)
					{
						// Take it off the list, and empty it
						csStrings.RemoveAt(nLastIndex);
						m_csaLine[nIndex].Empty();

						// In theory, if this string was the last in the column,
						// we should put a m_cListEnd char in front of the next to
						// last string in the column because this one is now gone.
						// We don't really need to do this, however, because we're
						// tossing out project types which are in the first row.

					}
				}
			}	
			IncrementRow(nIndex);

			if (f)
				break;
		}
	}
}
开发者ID:jimmccurdy,项目名称:ArchiveGit,代码行数:78,代码来源:WHlpWiz.cpp


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