本文整理汇总了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() );
}
示例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);
}
示例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);
}