本文整理汇总了C++中CStringArray::Copy方法的典型用法代码示例。如果您正苦于以下问题:C++ CStringArray::Copy方法的具体用法?C++ CStringArray::Copy怎么用?C++ CStringArray::Copy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CStringArray
的用法示例。
在下文中一共展示了CStringArray::Copy方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnChannelDatabaseAssociation
void CCANMonitorApp::OnChannelDatabaseAssociation(CStringArray* strFilePathArray, CFileDialog* fileDlg, INT iNumberOfActiveChannels)
{
sg_asDbParams[CAN].m_ppvActiveDB = (void**)&(theApp.m_pouMsgSgInactive);
sg_asDbParams[CAN].m_ppvImportedDBs = (void**)&(theApp.m_pouMsgSignal);
CChannelDatabaseAssociationDlg channelDatabaseAssociationDlg(sg_asDbParams[CAN], strFilePathArray, fileDlg, iNumberOfActiveChannels); // Create Dlg-instance
CStringArray strOldFilePathArray; // copy-funktion
strOldFilePathArray.RemoveAll();
strOldFilePathArray.Copy(*strFilePathArray);
if(channelDatabaseAssociationDlg.DoModal() == IDOK) // Show Dlg
{
// Check if dissociation is required
for(INT i = 0; i < iNumberOfActiveChannels; i++)
{
//if( strOldFilePathArray.GetAt(i) == (*strFilePathArray).GetAt(i) )
//{
// // Disscociate current channel // gelöschte dbs zurückgeben lassen und diese löschen
// int j = 0;
//}
}
}
else // Cancel
{
strFilePathArray->RemoveAll();
strFilePathArray->Copy(strOldFilePathArray);
}
// Association itself of new databases is located somewhere else
}
示例2: 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++;
}
}
}
示例3:
CString CSD3DDrawingColorCheck::CheckResultDesc(int nResult, const CheckData &checkData)
{
CString strResultDesc;
CStringArray arrCheckRule;
arrCheckRule.Copy(checkData.checkRule.arrRuleContent);
switch(nResult)
{
case CHECK_RESULT_NO_ERROR:
strResultDesc = L"模型标注颜色符合要求";
break;
case CHECK_RESULT_ERROR_VALUE:
strResultDesc.Format(L"标注颜色不符合要求(应该是\"%s-%s-%s\")", arrCheckRule.GetAt(0), arrCheckRule.GetAt(1), arrCheckRule.GetAt(2)) ;
break;
case CHECK_RESULT_INVALID_INPUT:
strResultDesc = L"输入值不合理";
default:
break;
}
return strResultDesc;
}
示例4: SetItemStrings
int CColListCtrl::SetItemStrings( int nItem, CStringArray &astr )
{
ASSERT( nItem <= 10000 );
if( m_aptrItemStrings.GetSize() <= nItem )
{
int nSizeOld = m_aptrItemStrings.GetSize();
m_aptrItemStrings.SetSize( nItem+1 );
for( int i=nSizeOld; i<m_aptrItemStrings.GetSize(); i++ )
{
m_aptrItemStrings.SetAt( i, NULL );
}
}
CStringArray * pastrNew = new CStringArray;
ASSERT( pastrNew && nItem < m_aptrItemStrings.GetSize() );
if( pastrNew && nItem < m_aptrItemStrings.GetSize() )
{
pastrNew->Copy( astr );
m_aptrItemStrings.SetAt( nItem, pastrNew );
return nItem;
}
return -1;
}
示例5: GetWindowCanDoQue
BOOL CInlineQueData::GetWindowCanDoQue(UINT nWindowID,CStringArray& queerial_id_array,CString& callStaffID,BOOL* pIsUsePower)
{
// if(m_lstInlineQue.GetCount() < 1)
// {
// return FALSE;
// }
CStringArray arrStrQueId;//可处理队列以及优先级
SLZWindow Window;
BOOL flag = m_rWindowTable.QueryWindowById(nWindowID,Window);
if(!flag)return FALSE;
Window.GetArrayQueId(arrStrQueId);//获取可处理队列及优先级
CString staffID = theApp.m_Controller.m_mapLoginList[Window.GetWindowId()];//获取登录STAFFID
if(staffID.IsEmpty())return FALSE;
if(arrStrQueId.GetCount() < 1)
{
return FALSE;
}
queerial_id_array.Copy(arrStrQueId);
callStaffID = staffID;
*pIsUsePower = Window.GetIsUsePower();
return TRUE;
}
示例6: InitApplication
void CzhftoolApp::InitApplication(void)
{
CMDIFrameWnd* pAcadFrame = acedGetAcadFrame();
CString strPaletteSetNames[] = {_T("平面图库"), _T("地铁图库")} ;
for (int iIndexSet=0; iIndexSet<2; iIndexSet++)
{
CZhfPaletteSet* pSet = new CZhfPaletteSet ;
CRect rect(0, 0, 320, 300);
pSet->Create(strPaletteSetNames[iIndexSet], WS_OVERLAPPED|WS_DLGFRAME, rect, pAcadFrame, PSS_EDIT_NAME | PSS_PROPERTIES_MENU | PSS_AUTO_ROLLUP | PSS_CLOSE_BUTTON) ;
if (iIndexSet==0)
{
CString strFolds[] = {_T("xhj\\lj"), _T("xhj\\lf"), _T("xhj\\lfn"), _T("xhj\\dc"), _T("xhj\\yg"), _T("xhj\\tg"), _T("xhj\\fs"), _T("xhj\\dt"), _T("dc"), _T("jyj"), _T("box"), _T("dltb"), _T("jdq"), _T("sign"), _T("bg"), _T("dz"), _T("conti"), _T("pmt")} ;
CString strPaletteNames[] = {_T("接车"), _T("发车"), _T("发车2"), _T("调车"), _T("预告"), _T("通过"), _T("复示"), _T("地铁"), _T("道岔"), _T("绝缘节"), _T("箱盒"), _T("电路"), _T("继电器"), _T("签字栏"), _T("表格"), _T("端子"), _T("连接符"), _T("其他")} ;
int iFilterModes[] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0} ;
for (int i=0; i<18; i++)
{
CZhfPalette* pZhfPalette = new CZhfPalette() ;
pZhfPalette->m_iFilterMode = iFilterModes[i] ;
CString strFilePath ;
CStringArray strArrayFile ;
strFilePath.Format(_T("%s\\support\\%s"), g_strBasePath, strFolds[i]) ;
CBlkUtility::FindFile(strFilePath, _T("dwg"), strArrayFile, 1) ;
CBlkUtility::SortStringArray(strArrayFile) ;
if (i==8)//将转辙机图形加入道岔项里面
{
strFilePath.Format(_T("%s\\support\\zzj"), g_strBasePath) ;
CStringArray strArrayPlus ;
CBlkUtility::FindFile(strFilePath, _T("dwg"), strArrayPlus, 1) ;
strArrayFile.Append(strArrayPlus) ;
}
if (i==12)
{
CStringArray strArrayFileNew ;
for (int iJqdIndex=0; iJqdIndex<strArrayFile.GetCount(); iJqdIndex++)
{
if (strArrayFile.GetAt(iJqdIndex).Find(_T("Bold"))==-1)
{
strArrayFileNew.Add(strArrayFile.GetAt(iJqdIndex)) ;
}
}
strArrayFile.RemoveAll() ;
strArrayFile.Copy(strArrayFileNew) ;
}
pZhfPalette->m_strArrayFile.Copy(strArrayFile) ;
CString strFileName ;
for (int j=0; j<strArrayFile.GetCount(); j++)
{
CBlkUtility::GetFileName(strArrayFile.GetAt(j), strFileName) ;
if (i<7)
{
CStringArray strArrayText ;
CBlkUtility::DivideString(strFileName, _T("_"), strArrayText) ;
strFileName.Format(_T("%s_%s"), strArrayText.GetAt(1), strArrayText.GetAt(2)) ;
}
pZhfPalette->m_strArrayFileName.Add(strFileName) ;
}
//if (i==1)
{
pZhfPalette->m_iCtrlWidth=80 ;
pZhfPalette->m_iCtrlHeight = 80 ;
}
pZhfPalette->Create(WS_CHILD | WS_VISIBLE|WS_VSCROLL,strPaletteNames[i], pSet, PS_EDIT_NAME);
//pZhfPalette->AddControls() ;
pSet->AddPalette(pZhfPalette) ;
}
// Finally show the palette set
pSet->EnableDocking(CBRS_ALIGN_ANY);
pSet->RestoreControlBar();
}
else if (iIndexSet==1)
{
CString strFolds[] = {_T("dt")} ;
CString strPaletteNames[] = {_T("地铁")} ;
int iFilterModes[] = {0} ;
for (int i=0; i<1; i++)
{
CZhfPalette* pZhfPalette = new CZhfPalette() ;
pZhfPalette->m_iFilterMode = iFilterModes[i] ;
CString strFilePath ;
CStringArray strArrayFile ;
strFilePath.Format(_T("%s\\support\\%s"), g_strBasePath, strFolds[i]) ;
CBlkUtility::FindFile(strFilePath, _T("dwg"), strArrayFile, 1) ;
CBlkUtility::SortStringArray(strArrayFile) ;
pZhfPalette->m_strArrayFile.Copy(strArrayFile) ;
CString strFileName ;
for (int j=0; j<strArrayFile.GetCount(); j++)
{
CBlkUtility::GetFileName(strArrayFile.GetAt(j), strFileName) ;
// if (i<7)
// {
// CStringArray strArrayText ;
//.........这里部分代码省略.........
示例7: if
BOOL CSD3DDrawingColorCheck::DoAction(void *pData, const CheckData &checkData)
{
pData;
CStringArray arrCheckRule;
double dRed;
double dGreen;
double dBlue;
arrCheckRule.Copy(checkData.checkRule.arrRuleContent);
int nCount = (int)arrCheckRule.GetSize();
if (nCount == 3)
{
for (int i = 0; i < 1; i++)
{
if (!IsNumber(arrCheckRule.GetAt(i)))
{
return FALSE;
}
else if (!DEQUAL(_wtof(arrCheckRule.GetAt(i)), 0.0) && !IsPoistive(arrCheckRule.GetAt(i)))
{
return FALSE;
}
else if (_wtof(arrCheckRule.GetAt(i)) > 255.0)
{
return FALSE;
}
}
dRed = _wtof(arrCheckRule.GetAt(0));
dGreen = _wtof(arrCheckRule.GetAt(1));
dBlue = _wtof(arrCheckRule.GetAt(2));
}
else
return FALSE;
ProColor color;
color.value.map.red = dRed/255;
color.value.map.green = dGreen/255;
color.value.map.blue = dBlue/255;
color.method = PRO_COLOR_METHOD_RGB;
ProModelitem item;
BOOL bSetError = FALSE;
for (int i=0, nType=-1; i <checkData.checkResult.arrErrorItems.GetCount(); i++)
{
ProTextStyle pTextStyle;
item.id = checkData.checkResult.arrErrorItems[i].nID;
item.owner = checkData.checkResult.arrErrorItems[i].pOwner;
nType = checkData.checkResult.arrErrorItems[i].nType;
if (PRO_NOTE == nType) // 注解
{
item.type = PRO_NOTE;
ProNoteTextStyleGet(&item, &pTextStyle);
ProTextStyleColorSet(pTextStyle, &color);
if (ProNoteTextStyleSet(&item, pTextStyle) != PRO_TK_NO_ERROR)
bSetError = TRUE;
}
else if (PRO_DIMENSION == nType) // 尺寸
{
item.type = PRO_DIMENSION;
ProDimensionTextstyleGet(&item, &pTextStyle);
ProTextStyleColorSet(pTextStyle, &color);
if (ProDimensionTextstyleSet(&item, pTextStyle) != PRO_TK_NO_ERROR)
bSetError = TRUE;
ProDimensionDisplayUpdate(&item);
}
else if (PRO_REF_DIMENSION == nType) // 参考尺寸
{
item.type = PRO_REF_DIMENSION;
ProDimensionTextstyleGet(&item, &pTextStyle);
ProTextStyleColorSet(pTextStyle, &color);
if (ProDimensionTextstyleSet(&item, pTextStyle) != PRO_TK_NO_ERROR)
bSetError = TRUE;
ProDimensionDisplayUpdate(&item);
}
else if (PRO_GTOL == nType) // 几何公差
{
item.type = PRO_GTOL;
ProGtolTextstyleGet(&item, &pTextStyle);
ProTextStyleColorSet(pTextStyle, &color);
if (ProGtolTextstyleSet(&item, pTextStyle) != PRO_TK_NO_ERROR)
bSetError = TRUE;
ProAnnotationDisplay(&item, NULL, NULL, NULL);
}
else if (PRO_SYMBOL_INSTANCE == nType) // 符号
{
item.type = PRO_SYMBOL_INSTANCE;
ProDtlsyminstdata pdtldata = NULL;
ProDtlsyminstDataGet(&item, PRODISPMODE_NUMERIC, &pdtldata);
ProDtlsyminstdataColorSet(pdtldata, &color);
if (ProDtlsyminstModify(&item, pdtldata) != PRO_TK_NO_ERROR)
bSetError = TRUE;
ProAnnotationDisplay(&item, NULL, NULL, NULL);
}
else if (PRO_SURF_FIN == nType) // 表面光洁度
{
item.type = PRO_SURF_FIN;
ProDtlsyminstdata pdtldata = NULL;
ProSurffinishDataGet(&item, PRODISPMODE_NUMERIC, &pdtldata);
ProDtlsyminstdataColorSet(pdtldata, &color);
if (ProSurffinishModify(&item, pdtldata) != PRO_TK_NO_ERROR)
//.........这里部分代码省略.........
示例8: CreateMenus
//.........这里部分代码省略.........
int i = 0;
int j = 0;
int k = 0;
VARIANT index;
VariantInit( &index );
V_VT( &index ) = VT_I4;
CArray<IAcadPopupMenu*, IAcadPopupMenu*> MnuAdrs;
long lIndex = 0;
TCHAR MenuName[256];
for ( i = 0; i < m_menuCount; i++ )
{
CString tmpMenu = m_TopMenuNames[i];
tmpMenu.Replace( _T( "&" ), _T( "" ) );
if( IsMenuExist( mnu, lIndex, tmpMenu, mnus ) ) //处理二次加载
{
V_I4( &index ) = lIndex;
}
else
{
// MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, (LPTSTR)(LPCTSTR)m_TopMenuNames[i], -1, MenuName, 256);
_tcscpy( MenuName, m_TopMenuNames[i] );
mnus->Add( MenuName, &mnu );
V_I4( &index ) = cnt++;
}
MnuAdrs.Add( mnu );
mnu->InsertInMenuBar( index );
}
IAcadPopupMenu* MenuItem = NULL;
int subMenuNum = 0;
CCADMenuArray* Menus;
TCHAR szSubMenu[256];
TCHAR szSubMenuMacro[256];
CString MenusName;
CString Menusorder;
for ( j = 0; j < m_menuCount; j++ )
{
Menus = m_menus.GetAt( j );
subMenuNum = Menus->GetSize();
for ( k = 0; k < subMenuNum; k++ )
{
mnu = MnuAdrs.GetAt( j );
if ( !_tcscmp( _T( "--" ), Menus->GetAt( k )->name ) )
{
V_I4( &index ) = k;
mnu->AddSeparator( index, &mnuitem );
}
else
{
V_I4( &index ) = k;
MenusName = Menus->GetAt( k )->name;
Menusorder = Menus->GetAt( k )->order;
_tcscpy( szSubMenu, MenusName );
_tcscpy( szSubMenuMacro, Menusorder );
//MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, (LPTSTR)(LPCTSTR)MenusName, -1, szSubMenu, 256);
//MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, (LPTSTR)(LPCTSTR)Menusorder, -1, szSubMenuMacro, 256);
if ( _tcscspn( Menus->GetAt( k )->name, _T( "*" ) ) < ( size_t )MenusName.GetLength() )
{
MenusName.TrimLeft( _T( '*' ) );
// MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, (LPTSTR)(LPCTSTR)MenusName, -1, szSubMenu, 256);
_tcscpy( szSubMenu, MenusName );
hr = mnu->AddSubMenu( index, szSubMenu, &MenuItem );
}
else if ( _tcscspn( Menus->GetAt( k )->name, _T( "$" ) ) < ( size_t )MenusName.GetLength() )
{
MenusName.TrimLeft( _T( '$' ) );
if( MenusName.Compare( _T( "--" ) ) == 0 ) //添加子菜单的分隔符
{
hr = MenuItem->AddSeparator( index, &mnuitem );
}
else
{
//MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, (LPTSTR)(LPCTSTR)MenusName, -1, szSubMenu, 256);
_tcscpy( szSubMenu, MenusName );
hr = MenuItem->AddMenuItem( index, szSubMenu, szSubMenuMacro, &mnuitem );
}
}
else
{
hr = mnu->AddMenuItem( index, szSubMenu, szSubMenuMacro, &mnuitem );
}
}
}
}
for ( i = 0; i < MnuAdrs.GetSize(); i++ )
{
MnuAdrs[i]->Release();
}
mnuitem->Release();
mnus->Release();
mnuGrp->Release();
pMainFrame->UnlockWindowUpdate();
stcMyTopMenuNames.Copy( m_TopMenuNames ); //将顶级菜单名存入静态数组中,卸载时使用
//return ;
}
示例9: GetDisplayNames
void COXIteratorService::GetDisplayNames(CStringArray& sBuffer)
{
ASSERT(m_nPos != OXITERATORSERVICE_POS_NULL);
sBuffer.Copy(m_SrvDspNames);
}
示例10: GetSelection
void CMultiSelDlg::GetSelection(CStringArray& rastrSelection)
{
rastrSelection.Copy(m_astrStringsSel);
}
示例11: CreateToolBars
void AppToolBar::CreateToolBars()
{
CMDIFrameWnd* pMainFrame = acedGetAcadFrame();
pMainFrame->LockWindowUpdate();
// 获取主菜单组
IAcadMenuGroup* mnuGrp = NULL;
if ( !GetAcadMenuGroup( &mnuGrp ) )
return ;
//得到所有菜单组
HRESULT hr = S_OK;
IAcadToolbars* acToolbars = NULL;
hr = mnuGrp->get_Toolbars( &acToolbars );
CString appFileName = acedGetAppName(); //取出完整的应用程序名称,含路径
TCHAR dir[_MAX_DIR], drive[_MAX_DRIVE], path[_MAX_PATH];
_tsplitpath( appFileName, drive, dir, NULL, NULL );
_tmakepath( path, drive, dir, NULL, NULL );
VARIANT index;
VariantInit( &index );
V_VT( &index ) = VT_I4;
TCHAR MenuName[256];
int delta = 30; // 工具栏间距
int top = 200, left = 200;
for ( int i = 0; i < m_menuCount; i++ )
{
IAcadToolbar* acToolbar = NULL;
_tcscpy( MenuName, m_TopMenuNames[i] );
hr = acToolbars->Add( MenuName, &acToolbar );
acToolbar->put_Visible( true );
acToolbar->Dock( acToolbarFloating );
acToolbar->Float( top + i * delta, left, 1 );
CCADToolButtonArray* Menus = m_menus[i];
COleVariant flyOutButton;
for ( int j = 0; j < Menus->GetSize(); j++ )
{
// 添加按钮
V_I4( &index ) = ( long )j;
CADToolButton* btn = Menus->GetAt( j );
IAcadToolbarItem* acToolbarItem = NULL;
if( _tcscmp( _T( "--" ), btn->name ) == 0 )
{
hr = acToolbar->AddSeparator( index, &acToolbarItem );
}
else
{
hr = acToolbar->AddToolbarButton( index, btn->name, btn->help, btn->order, flyOutButton, &acToolbarItem );
CString bmpFile;
bmpFile.Format( _T( "%s%s\\%s" ), path, BMP_DIR, btn->bmp );
TCHAR szBmpFile[256];
_tcscpy( szBmpFile, bmpFile );
//acutPrintf(_T("\n路径:%s"), szBmpFile);
hr = acToolbarItem->SetBitmaps( szBmpFile, szBmpFile );
}
}
//acToolbarItem->Release();
acToolbar->Release();
}
acToolbars->Release();
mnuGrp->Release();
pMainFrame->UnlockWindowUpdate();
stcMyToolBarNames.Copy( m_TopMenuNames ); //将工具栏名称存入静态数组中,卸载时使用
}
示例12: GetVolumeArray
void CPort::GetVolumeArray( CStringArray& strVolumeArray )
{
strVolumeArray.Copy(m_strVolumeArray);
}