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


C++ CUIntArray::GetSize方法代码示例

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


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

示例1: LoadIcons

void CXTPRibbonBuilder::LoadIcons(int nId, CUIntArray& arrIcons)
{
	CXTPImageManager* pImageManager = m_pCommandBars->GetImageManager();


	HBITMAP hBitmap = CXTPImageManagerIcon::LoadBitmapFromResource(MAKEINTRESOURCE(nId), NULL);
	if (hBitmap)
	{
		BITMAP bmpInfo;
		::GetObject(hBitmap, sizeof(BITMAP), &bmpInfo);

		CSize szBitmap = CSize(bmpInfo.bmWidth, bmpInfo.bmHeight);

		int nCount = 0;

		if (szBitmap.cy >= 15 && szBitmap.cy <= 16)
		{
			nCount = szBitmap.cx / 16;
		}
		else if (szBitmap.cy == 32)
		{
			nCount = szBitmap.cx / 32;
		}

		while (arrIcons.GetSize() < nCount)
			arrIcons.Add(0);

		DeleteObject(hBitmap);
	}

	pImageManager->SetIcons(nId, arrIcons.GetData(), (int)arrIcons.GetSize(), CSize(0, 0), xtpImageNormal);

}
开发者ID:lai3d,项目名称:ThisIsASoftRenderer,代码行数:33,代码来源:XTPRibbonBuilder.cpp

示例2: SetTableColumn

BOOL CExportDB::SetTableColumn( CStringArray & astrColumnName, CUIntArray & anWidth )
{
	ASSERT( astrColumnName.GetSize() == anWidth.GetSize() );
	if( astrColumnName.GetSize() != anWidth.GetSize() )
		return FALSE;

	m_astrColumnName.Copy( astrColumnName );
	m_anColumnWidth.Copy( anWidth );
	ASSERT( m_astrColumnName.GetSize() > 0 );
	return m_astrColumnName.GetSize() > 0;
}
开发者ID:amikey,项目名称:tradingstrategyking,代码行数:11,代码来源:ListExportDlg.cpp

示例3: Reorder

void CDiagramEntityContainer::Reorder( const CUIntArray &order )
{
	if (order.GetSize() != GetSize()) return;

	CObArray temp;
	temp.SetSize( order.GetSize() );

	for (int i = 0; i < order.GetSize(); i++)
		temp[order[i]] = m_objs[i];

	m_objs.Copy( temp );
	SetModified( TRUE);
}
开发者ID:Admin-Yukiko,项目名称:Iris1_DeveloperTools,代码行数:13,代码来源:DiagramEntityContainer.cpp

示例4: Essence

void     Essence(CUIntArray& aX,CUIntArray& aY)//loai bo nhung phan tu trung nhau
{
    aY.RemoveAll();
    for(int i=0; i<aX.GetSize(); i++)
        if(FindUInt(aX[i],aY)==-1)//Neu khong tim thay
            aY.Add(aX[i]);
}
开发者ID:ngphloc,项目名称:design,代码行数:7,代码来源:Tool.cpp

示例5: FindUInt

int  FindUInt(UINT x, CUIntArray& aUInt)
{
    for(int i=0; i<aUInt.GetSize(); i++)
        if(x==aUInt[i])
            return i;
    return -1;
}
开发者ID:ngphloc,项目名称:design,代码行数:7,代码来源:Tool.cpp

示例6: Common

void     Common(CUIntArray& aX,CUIntArray& aY,CUIntArray& aZ )
{
    CUIntArray aTemp;
    for(int i=0; i<aX.GetSize(); i++)
        if(FindUInt(aX[i],aY)!=-1)//Neu tim thay
            aTemp.Add(aX[i]);
    Essence(aTemp,aZ);
}
开发者ID:ngphloc,项目名称:design,代码行数:8,代码来源:Tool.cpp

示例7: OnInitDialog

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

	// TODO:  Add extra initialization here
	m_baudRate.Format("9600");
	c_SetupComPort.ResetContent();
	m_baudRateStatic="9600";
	CUIntArray ports;
	int	ii;
	char buf[20];

	if (CEnumerateSerial::UsingGetDefaultCommConfig(ports))
	{
		for (ii=0; ii<ports.GetSize(); ii++)
		{
			_snprintf(buf,20,"COM%d",ports[ii]);
			c_SetupComPort.AddString(buf);
		}
      
	}

	CRect rect;
	c_listCtrl.GetClientRect(&rect);
	int cw=rect.Width()/3;
	c_listCtrl.InsertColumn(0,_T("Col 1"),0,cw);
	c_listCtrl.InsertColumn(1,_T("Col 2"),0,cw);
	c_listCtrl.InsertColumn(2,_T("Col 3"),0,cw);

	LVITEM lvi;
	CString lvs;

	int jj;

	for (ii=0; ii<3; ii++) {

		lvi.mask = LVIF_TEXT;
		lvi.iItem = ii;

		for (jj=0; jj<3; jj++) {

			// lvs.Format(_T("ii %d jj %d"),ii,jj);
			lvs.Format(_T("%d ii %d jj %d"),rand(),ii,jj);
			lvi.iSubItem = jj;
			lvi.pszText=(LPTSTR)(LPCTSTR)(lvs);
			if (jj==0)
				c_listCtrl.InsertItem(&lvi);
			else
				c_listCtrl.SetItem(&lvi);
		}
	}

	c_listCtrl.SetExtendedStyle(c_listCtrl.GetExtendedStyle() | LVS_EX_FULLROWSELECT);

	UpdateData(FALSE);
	return TRUE;  // return TRUE unless you set the focus to a control
	// EXCEPTION: OCX Property Pages should return FALSE
}
开发者ID:drkjschmidt,项目名称:rudolf,代码行数:58,代码来源:SetupDlg.cpp

示例8: GetFormatTypeIndex

UINT GetFormatTypeIndex(UINT nFormat)
{
	int i; for (i=0;i<arFormatType.GetSize();i++) {
		if (arFormatType.GetAt(i) == nFormat) {
			return i;
		}
	}
	return -1;
}
开发者ID:leiqunni,项目名称:STEP_Unicode,代码行数:9,代码来源:STEP_api.cpp

示例9: Refresh

//////////////////
// Refresh all colors, fonts, etc. For WM_SETTINGCHANGE, WM_SYSCOLORCHANGE.
//
void CCoolMenuManager::Refresh()
{
	// first copy list (array) of toolbar IDs now loaded.
	CUIntArray arToolbarID;
	arToolbarID.Copy(m_arToolbarID);

	// destroy everything
	Destroy();

	// re-load toolbars.
	int nToolbars = arToolbarID.GetSize();
	for (int i = 0; i < nToolbars; i++)
		LoadToolbar(arToolbarID[i]);
}
开发者ID:ZhaoboMeng,项目名称:k-line-print,代码行数:17,代码来源:CoolMenu.cpp

示例10: WriteSimpleArray

void EditSerializer::WriteSimpleArray(DataField field, const CUIntArray& a)
{
	CString result;
	char buf[16];

	for (int i=0; i<a.GetSize(); i++)
	{
		unsigned int val = a.GetAt(i);
		if (i > 0)
			result += ";";

		sprintf(buf, "%d", val);
		result += buf;
	}

	WriteString(field, (LPCTSTR)result);
}
开发者ID:steve-stanton,项目名称:backsight,代码行数:17,代码来源:EditSerializer.cpp

示例11: if

int	CUpdateUtil::RealVersionCheck(CUIntArray& unarrayClient, CUIntArray& unarrayServer)
{
	int i = 0;
	int count = 0;

	if(unarrayClient.GetSize() == unarrayServer.GetSize()){
		count = unarrayClient.GetSize();
		for(i=0; i <count; i++){
			if(unarrayClient.ElementAt(i) != unarrayServer.ElementAt(i)){
				if(unarrayClient.ElementAt(i) < unarrayServer.ElementAt(i))			return UPDATE_FLAG_UPDATE;
				else if(unarrayClient.ElementAt(i) > unarrayServer.ElementAt(i))	return UPDATE_FLAG_NORMAL;
			}
		}
	}
	else if(unarrayClient.GetSize() < unarrayServer.GetSize()){	// 1.1 : 1.1.0.1
		count = unarrayClient.GetSize();
		for(i=0; i <count; i++){
			if(unarrayClient.ElementAt(i) != unarrayServer.ElementAt(i)){
				if(unarrayClient.ElementAt(i) < unarrayServer.ElementAt(i))			return UPDATE_FLAG_UPDATE;
				else if(unarrayClient.ElementAt(i) > unarrayServer.ElementAt(i))	return UPDATE_FLAG_NORMAL;
			}
		}
		return UPDATE_FLAG_UPDATE;
	}
	else{	// unarrayClient.GetSize() > unarrayServer.GetSize() // 1.1.0.1 : 1.2
		count = unarrayServer.GetSize();
		for(i=0; i <count; i++){
			if(unarrayClient.ElementAt(i) != unarrayServer.ElementAt(i)){
				if(unarrayClient.ElementAt(i) < unarrayServer.ElementAt(i))			return UPDATE_FLAG_UPDATE;
				else if(unarrayClient.ElementAt(i) > unarrayServer.ElementAt(i))	return UPDATE_FLAG_NORMAL;
			}
		}
	}

	return UPDATE_FLAG_NORMAL;
}
开发者ID:jongha,项目名称:update-dll,代码行数:36,代码来源:UpdateUtil.cpp

示例12: ExportList

void CSListView::ExportList( CListExportDlg * pDlg )
{
	ASSERT( pDlg );
	if( NULL == pDlg )
		return;

	int	nColumnCount	=	m_Grid.GetColumnCount();
	ASSERT( nColumnCount > 0 );
	if( nColumnCount <= 0 )
		return;

	CStockContainer & container = AfxGetSListStockContainer();

	// Get Current StockList Time
	DWORD	dwDate;
	CSPTime	sptime;
	CSPTime	time;
	if( container.GetCurrentType( NULL, NULL, &dwDate )
		&& (-1 != dwDate || container.GetLatestTechDate(&dwDate))
		&& sptime.FromStockTimeDay( dwDate ) )
		time	=	CSPTime( sptime.GetTime() );

	// Set Column
	CStringArray	astrColumn;
	CUIntArray		anWidth;
	CUIntArray		anParams;
	for(int nCol = 0; nCol < nColumnCount; nCol ++ )
	{
		astrColumn.Add( m_Grid.GetItemText(0,nCol) );
		anWidth.Add( m_Grid.GetColumnWidth(nCol) );
		anParams.Add( m_Grid.GetItemData(0,nCol) );
	}
	if( ! pDlg->ExportBegin( astrColumn, anWidth, TRUE )
		|| ! pDlg->ExportOpenTable( time, TRUE ) )
		return;

	container.Lock();

	// set Item
	int	nCount = 0, nTotalCount = 0;
	if( pDlg->m_bItemAll )
	{
		nTotalCount	=	m_Grid.GetRowCount()-1;
		pDlg->SetProgressRange( 0, nTotalCount );
		for( int nRow=1; nRow<m_Grid.GetRowCount(); nRow++ )
		{
			CStringArray	astrItemText;
			astrItemText.SetSize( 0, nColumnCount+1 );
			LPARAM	id	=	m_Grid.GetItemData(nRow,0);
			CStockInfo & info	=	container.GetStockInfoByID(id);
			for(nCol=0; nCol<anParams.GetSize(); nCol++ )
			{
				astrItemText.Add( m_Grid.GetItemText( nRow, nCol ) );
			}
			pDlg->ExportAddItem( astrItemText );

			nCount	++;
			pDlg->SetProgress( nCount );
		}
	}
	else if( pDlg->m_bItemSelected )
	{
		nTotalCount	=	m_Grid.GetSelectedCount();
		pDlg->SetProgressRange( 0, nTotalCount );
		for( int nRow=1; nRow<m_Grid.GetRowCount(); nRow++ )
		{
			BOOL	bSelected	=	FALSE;
			for( nCol=0; nCol<m_Grid.GetColumnCount(); nCol ++ )
				bSelected	|=	( m_Grid.GetItemState(nRow,nCol) & GVIS_SELECTED );
			if( !bSelected )
				continue;

			CStringArray	astrItemText;
			astrItemText.SetSize( 0, nColumnCount+1 );
			LPARAM	id	=	m_Grid.GetItemData(nRow,0);
			CStockInfo & info	=	container.GetStockInfoByID(id);
			for(nCol=0; nCol<anParams.GetSize(); nCol++ )
			{
				astrItemText.Add( m_Grid.GetItemText( nRow, nCol ) );
			}
			pDlg->ExportAddItem( astrItemText );

			nCount	++;
			pDlg->SetProgress( nCount );
		}
	}
	else if( pDlg->m_bItemDefine )
	{
		nTotalCount	=	min(m_Grid.GetRowCount()-1,pDlg->m_nItemEnd) - max(1,pDlg->m_nItemBegin) + 1;
		pDlg->SetProgressRange( 0, nTotalCount );
		for( int nRow=max(1,pDlg->m_nItemBegin); nRow<=min(m_Grid.GetRowCount()-1,pDlg->m_nItemEnd); nRow++ )
		{
			CStringArray	astrItemText;
			astrItemText.SetSize( 0, nColumnCount+1 );
			LPARAM	id	=	m_Grid.GetItemData(nRow,0);
			CStockInfo & info	=	container.GetStockInfoByID(id);
			for(nCol=0; nCol<anParams.GetSize(); nCol++ )
			{
				astrItemText.Add( m_Grid.GetItemText( nRow, nCol ) );
			}
//.........这里部分代码省略.........
开发者ID:darwinbeing,项目名称:trade,代码行数:101,代码来源:SListView.cpp

示例13: OnUpdate

void CSListView::OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint) 
{
	// TODO: Add your specialized code here and/or call the base class
	if( UPDATE_HINT_SLISTVIEW != lHint )
		return;
	if( IsWindowVisible() )
		SetFocus( );
	int	nColumnCount	=	m_Grid.GetColumnCount();
	if( nColumnCount <= 0 )
		return;

	if( GetParentFrame()->GetSafeHwnd() != AfxGetMainFrame()->GetActiveFrame()->GetSafeHwnd() )
	{
		m_bShouldUpdate	=	TRUE;
		return;
	}
	m_bShouldUpdate	=	FALSE;

	CStockContainer & container = AfxGetSListStockContainer();
	container.Lock();

	m_Grid.DeleteNonFixedRows();

	// Progress
	CMainFrame	* pMainFrame = AfxGetMainFrame();
	if( pMainFrame )
	{
		pMainFrame->ShowProgressBar( );
		pMainFrame->SetProgress( 0 );
		pMainFrame->SetMessageText( IDS_MAINFRAME_WAITING );
	}

	CUIntArray	anParams;
	anParams.SetSize( 0, nColumnCount );
	for( int nCol=0; nCol < nColumnCount; nCol ++ )
	{
		LPARAM	lParam	=	m_Grid.GetItemData( 0, nCol );
		anParams.Add( lParam );
	}

	CRect rectClient;
	GetClientRect( &rectClient );
	int nPageCount = 1 + rectClient.Height() / abs(m_Grid.GetFixedRowHeight()) + 1;

	for( int i=0; i<container.GetSize(); i++ )
	{
		CStockInfo & info = container.GetStockInfoByID(i);

		int nRow = m_Grid.InsertRow( info.GetStockName() );
		m_Grid.SetItemData( nRow, 0, i );

		for( int nCol=0; nCol<anParams.GetSize(); nCol++ )
		{
			m_Grid.SetItemFormat( nRow, nCol, DT_CENTER|DT_VCENTER|DT_SINGLELINE );
			m_Grid.SetItemText( nRow, nCol, AfxGetVariantDispString( anParams[nCol], info, &container ) );
			m_Grid.SetItemBkColour( nRow, nCol, AfxGetProfile().GetColor(CColorClass::clrSListBK) );
			m_Grid.SetItemFgColour( nRow, nCol, AfxGetVariantColor( anParams[nCol], info ) );
			if( anParams[nCol] == SLH_DATE )
				m_Grid.SetColumnWidth( nCol, 80 );
			if( anParams[nCol] == SLH_CODE )
				m_Grid.SetColumnWidth( nCol, 60 );
		}

		if( i == nPageCount+5 )
		{
			m_Grid.Invalidate( );
			MSG		msg;
			while (::PeekMessage(&msg, NULL, NULL, NULL, PM_NOREMOVE) )
				AfxGetApp()->PumpMessage();
		}
		if( pMainFrame )
			pMainFrame->SetProgress( 100*i/container.GetSize() );
	}

	// Set Average and Weight Average
//	SetAverageItem( m_Grid, container, FALSE );

	// Sort If Needed
	if( -1 != m_nColSort )
	{
		LPARAM	lParam	=	m_Grid.GetItemData( 0, m_nColSort );
		if( lParam >= 0 )
		{
			CStockContainer::m_pSortContainer	=	&container;
			container.m_nSortVariantID	=	lParam;
			container.m_bSortAscend		=	m_bSortAscend;
			m_Grid.SortItems( ItemCompareFunc, 0, TRUE );
		}
	}

	if( pMainFrame )
	{
		pMainFrame->SetProgress( 100 );
		pMainFrame->HideProgressBar( );
		pMainFrame->SetMessageText( IDS_MAINFRAME_FINISHED );
		pMainFrame->SetMessageText( IDS_HELPTIP_SLIST );
	}

	if( m_bFirstUpdate )
		m_Grid.AutoSizeColumns( );
//.........这里部分代码省略.........
开发者ID:ZhaoboMeng,项目名称:k-line-print,代码行数:101,代码来源:SListView.cpp

示例14: SelectBlock

void CXTPReportSelectedRows::SelectBlock(int nBlockBegin, int nEnd, BOOL bControlKey)
{
	CXTPReportRows* pRows;
	switch(m_nRowType)
	{
		case xtpRowTypeHeader : pRows = m_pControl->GetHeaderRows(); break;
		case xtpRowTypeFooter : pRows = m_pControl->GetFooterRows(); break;
		default : pRows = m_pControl->GetRows(); break;
	}
	int nRowsCount(0);
	if (pRows)
		nRowsCount = pRows->GetCount();
	BOOL bGo = (nBlockBegin >= 0 && nBlockBegin < nRowsCount && nEnd < nRowsCount);
	if (!bGo)
	{
		Clear(GetNotifyOnSelectedRowsClear());
		return;
	}

	if (bControlKey == FALSE)
	{
		nBlockBegin = m_nRowBlockBegin != -1 ? m_nRowBlockBegin : nBlockBegin;

		int nBegin = nBlockBegin;

		if (nBegin == -1 || nEnd == -1)
			return;

		if (nBegin > nEnd)
		{
			nBegin = nEnd;
			nEnd = nBlockBegin;
		}

		if (m_arrSelectedBlocks.GetSize() == 1 && m_arrSelectedBlocks[0].nIndexBegin == nBegin &&
			m_arrSelectedBlocks[0].nIndexEnd == nEnd + 1)
		{
			return;
		}

		XTPReportRowType nRowType = m_nRowType;
		Clear(GetNotifyOnSelectedRowsClear());
		m_nRowType = nRowType;
		if (m_nRowBlockBegin == -1) m_nRowBlockBegin = nBlockBegin;


		BOOL bSkipGroupFocus = m_pControl->IsSkipGroupsFocusEnabled();
		BOOL bHasGroups = m_pControl->GetColumns()->GetGroupsOrder()->GetCount() != 0;

		if (!bHasGroups || !bSkipGroupFocus)
		{
			_InsertBlock(0, nBegin, nEnd + 1);
		}
		else
		{
			for (int i = nBegin; i <= nEnd; i++)
			{
				CXTPReportRow* pRow = pRows->GetAt(i);
				if (!pRow)
					continue;

				if (!bSkipGroupFocus || !pRow->IsGroupRow() || !pRow->IsExpanded() || (i == nBegin) || (i == nEnd))
				{
					Add(pRow);
				}
			}
		}

		// notify owner the selection state has changed.
		_NotifyStateChanged(nBegin, nEnd);
	}
	else
	{
		int kSB = (int) m_arrSelectedBlocks.GetSize();
		if (kSB > 0)
		{
			int iMin = m_arrSelectedBlocks[0].nIndexBegin;
			int iMax = m_arrSelectedBlocks[kSB - 1].nIndexEnd;
			if (nEnd >= iMin && nEnd < iMax)
			{
				return;
			}
		}
		BOOL bSkipGroupFocus = FALSE;//m_pControl->IsSkipGroupsFocusEnabled();
		BOOL bHasGroups = m_pControl->GetColumns()->GetGroupsOrder()->GetCount() != 0;
		BOOL bWasShiftKey = m_pControl->m_bWasShiftKey;

		if (m_nRowBlockBegin != -1)
			nBlockBegin = m_nRowBlockBegin;
		int nBegin(nBlockBegin), iB, iE;
		if (nBegin == -1 || nEnd == -1)
		{
			return;
		}
		BOOL bSwap = SwapIfNeed(nBegin, nEnd);
		int nArSz = (int) m_arrSelectedBlocks.GetSize();

		CUIntArray ar;
		if (nArSz > 0)
		{
//.........这里部分代码省略.........
开发者ID:lai3d,项目名称:ThisIsASoftRenderer,代码行数:101,代码来源:XTPReportSelectedRows.cpp

示例15: TestInitialiseSaveAsDlgData_DocTypeEffect

void DVControllerTests::TestInitialiseSaveAsDlgData_DocTypeEffect()
{
	AFX_MANAGE_STATE(AfxGetAppModuleState());

	CStdString sSaveFilters;
	int iFormatCount=0;

	CMDIFrameWnd* pMainFrame = DYNAMIC_DOWNCAST(CMDIFrameWnd, AfxGetMainWnd());
	CChildFrame *pFrame = DYNAMIC_DOWNCAST( CChildFrame, pMainFrame->MDIGetActive() );
	assertTest( pFrame );
	
	CUIntArray aFormats;
	LONG lFormatIndex	= 1;
	LONG lCurrentSaveFormatID = -7;
	LONG lSaveFormatIDDefault = GetApp()->GetDVController(pFrame)->GetComparisonDocController().GetSaveFormatAsDVCode();
//for rtf
	LONG lFlags = 0;
	lFlags |= WSDOCUMENTPROVIDERLib::DF_NEW_DOCUMENT;
	if (lSaveFormatIDDefault !=6)
	{
		lSaveFormatIDDefault=6; //for test rtf
	}
	
	bool origFileFormatValue = Workshare::OptionApi::GetBool(L"AllowFileFormatChange");
	bool origExtSaveFormats = Workshare::OptionApi::GetBool(L"EnableExtendedFileFormats");
	try
	{
		Workshare::OptionApi::SetBool(L"AllowFileFormatChange", false);

		sSaveFilters = GetApp()->GetDVController(pFrame)->GetComparisonDocController().InitialiseSaveAsDlgData(aFormats, lFormatIndex, lCurrentSaveFormatID, lSaveFormatIDDefault, lFlags, docNew);
		int iCount = (x64_int_cast)aFormats.GetSize();
		assertTest(iCount==1);
		CStdString sFormat = _T("Rich Text Format ( *.rtf)|*.rtf||");
		assertTest(sSaveFilters.CompareNoCase(sFormat)==0);	

		sSaveFilters = _T("");
		aFormats.RemoveAll();

		sSaveFilters = GetApp()->GetDVController(pFrame)->GetComparisonDocController().InitialiseSaveAsDlgData(aFormats, lFormatIndex, lCurrentSaveFormatID, lSaveFormatIDDefault, lFlags, docAttachToModified);
		iCount = (x64_int_cast)aFormats.GetSize();
		assertTest(iCount==1);
		sFormat = _T("Rich Text Format ( *.rtf)|*.rtf||");
		assertTest(sSaveFilters.CompareNoCase(sFormat)==0);	

		sSaveFilters = _T("");
		aFormats.RemoveAll();

		Workshare::OptionApi::SetBool(L"EnableExtendedFileFormats", true);

		sSaveFilters = GetApp()->GetDVController(pFrame)->GetComparisonDocController().InitialiseSaveAsDlgData(aFormats, lFormatIndex, lCurrentSaveFormatID, lSaveFormatIDDefault, lFlags, docVersionOfOriginal);
		iCount =(x64_int_cast) aFormats.GetSize();
		assertTest(iCount==1);
		sFormat = _T("Adobe Acrobat File ( *.pdf)|*.pdf||");
		assertTest(sSaveFilters.CompareNoCase(sFormat)==0);	

		Workshare::OptionApi::SetBool(L"AllowFileFormatChange", true);
		Workshare::OptionApi::SetBool(L"EnableExtendedFileFormats", false);
		sSaveFilters = _T("");
		aFormats.RemoveAll();

		sSaveFilters = GetApp()->GetDVController(pFrame)->GetComparisonDocController().InitialiseSaveAsDlgData(aFormats, lFormatIndex, lCurrentSaveFormatID, lSaveFormatIDDefault, lFlags, docNew);
		iCount = (x64_int_cast)aFormats.GetSize();
		sFormat = "Workshare DeltaFile ( *.wdf)|*.wdf|Word 97-2003 Document ( *.doc)|*.doc|Word Document ( *.docx)|*.docx|Text Only ( *.txt)|*.txt|Rich Text Format ( *.rtf)|*.rtf|HTML Document ( *.htm)|*.htm|Adobe Acrobat File ( *.pdf)|*.pdf|Adobe Acrobat PDF/A File (*.pdf)|*.pdf||";
		
		assertMessage(iCount==8,_T("If this fails turn off \"Use Extended File Format\" flag in DMS config to make this work"));
		assertTest(sSaveFilters.CompareNoCase(sFormat) == 0);  

		sSaveFilters = _T("");
		aFormats.RemoveAll();

		sSaveFilters = GetApp()->GetDVController(pFrame)->GetComparisonDocController().InitialiseSaveAsDlgData(aFormats, lFormatIndex, lCurrentSaveFormatID, lSaveFormatIDDefault, lFlags, docAttachToModified);
		iCount = (x64_int_cast)aFormats.GetSize();
		sFormat = "Workshare DeltaFile ( *.wdf)|*.wdf|Word 97-2003 Document ( *.doc)|*.doc|Word Document ( *.docx)|*.docx|Text Only ( *.txt)|*.txt|Rich Text Format ( *.rtf)|*.rtf|HTML Document ( *.htm)|*.htm|Adobe Acrobat File ( *.pdf)|*.pdf|Adobe Acrobat PDF/A File (*.pdf)|*.pdf||";
		
		assertMessage(iCount==8,_T("If this fails turn off \"Use Extended File Format\" flag in DMS config to make this work"));
		assertTest(sSaveFilters.CompareNoCase(sFormat) == 0);  

		sSaveFilters = _T("");
		aFormats.RemoveAll();

		sSaveFilters = GetApp()->GetDVController(pFrame)->GetComparisonDocController().InitialiseSaveAsDlgData(aFormats, lFormatIndex, lCurrentSaveFormatID, lSaveFormatIDDefault, lFlags, docVersionOfOriginal);
		iCount = (x64_int_cast)aFormats.GetSize();
		sFormat = "Workshare DeltaFile ( *.wdf)|*.wdf|Word 97-2003 Document ( *.doc)|*.doc|Word Document ( *.docx)|*.docx|Text Only ( *.txt)|*.txt|Rich Text Format ( *.rtf)|*.rtf|HTML Document ( *.htm)|*.htm|Adobe Acrobat File ( *.pdf)|*.pdf|Adobe Acrobat PDF/A File (*.pdf)|*.pdf||";
		
		assertMessage(iCount==8,_T("If this fails turn off \"Use Extended File Format\" flag in DMS config to make this work"));
		assertTest(sSaveFilters.CompareNoCase(sFormat) == 0);  
	}
	catch(...)
	{
		_ASSERTE(!_T("Catch ... How did we get here?"));
		Workshare::OptionApi::SetBool(L"AllowFileFormatChange", origFileFormatValue);
		Workshare::OptionApi::SetBool(L"EnableExtendedFileFormats", origExtSaveFormats);
		throw;
	}
	Workshare::OptionApi::SetBool(L"AllowFileFormatChange", origFileFormatValue);
	Workshare::OptionApi::SetBool(L"EnableExtendedFileFormats", origExtSaveFormats);
}
开发者ID:killbug2004,项目名称:WSProf,代码行数:97,代码来源:DVControllerTests.cpp


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