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


C++ CObArray::SetSize方法代码示例

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


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

示例1: GetArray

void CObBinTree::GetArray( CObArray& array )
{
	array.SetSize( 0 );
	WalkTree( StoreInArray, (LPVOID)&array, TV_INORDER );

	ASSERT( array.GetSize()==GetCount() );
}
开发者ID:EISALab,项目名称:AMGAgroundwater,代码行数:7,代码来源:tree_ob.cpp

示例2: 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

示例3: OnOpenDocument

// **************************************************************************
// OnOpenDocument ()
//
// Description:
//	Open document event handler.
//
// Parameters:
//  none
//
// Returns:
//  BOOL - TRUE if success.
// **************************************************************************
BOOL CKDocument::OnOpenDocument (LPCTSTR lpszPathName) 
	{
	// Perform default processing:
	if (!CDocument::OnOpenDocument (lpszPathName))
		return (FALSE);

	// Must do some additional work if we have a server object:
	if (m_pServerHead)
		{
		// Update status bar text to indicate we are loading project:
		CKStatusBarText cText (IDS_LOADING_PROJECT);

		// Update all views so the user can see progress:
		UpdateAllViews (NULL, HINT_LOAD_PROJECT, m_pServerHead);

		// Build a list of servers to load to pass along to a worker thread 
		// for processing:
		CObArray cServerList;

		// Catch memory exceptions that could get thrown by object array:
		try
			{
			// Allocate memory for array of server objects:
			cServerList.SetSize (m_cdwServers);

			// Create a CKServer pointer and set it to first server in linked list:
			CKServer *pServer = m_pServerHead;

			// Loop over servers in linked list:
			for (DWORD dw = 0; dw < m_cdwServers; dw++)
				{
				// Put pointer to server in object array:
				ASSERT (pServer);
				cServerList [dw] = (CObArray *)pServer;

				// Get next server in linked list:
				pServer = pServer->GetNext ();
				}

			ASSERT (pServer == NULL);	// list and count in sync ?
			}
		
		catch (CMemoryException *e)
			{
			// If memory exception thrown, delet exception object and return FALSE
			// to indicate failure.
			e->Delete ();
			return (FALSE);
			}

		// Fill a structre to pass along to worker thread.  Structure will
		// contain a pointer to out list of servers and task specification
		// (start multiple servers).
		WORKERTHREADARG tArg;
		tArg.eTask = WORKERTHREADARG::START_MULTIPLE_SERVER;
		tArg.pvObjectA = (void *)&cServerList;

		// Run the worker thread to start all server connections:
		RunWorkerThread (&tArg);
		}

	// If we make it here, all went OK, so return TRUE:
	return (TRUE);
	}
开发者ID:wfmdyh,项目名称:wecan,代码行数:76,代码来源:document.cpp


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