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


C++ CObArray类代码示例

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


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

示例1: GetFloatingBars

//-----------------------------------------------------------------
void CMRCFrameWndSizeDock::GetFloatingBars(CObArray & arrWnd)
// Appends the floating bars, visible bars to an array
//-----------------------------------------------------------------
{
	CPtrList & listControlBars = m_listControlBars;
	
	POSITION pos = listControlBars.GetHeadPosition();
	while (pos != NULL)
	{
		CControlBar* pBar = (CControlBar*)listControlBars.GetNext(pos);
		ASSERT(pBar != NULL);
		if (!pBar->IsDockBar() && pBar->IsFloating() && pBar->IsVisible()) 	// not a dockbar and floating....
		{
			ASSERT(pBar->m_pDockBar != NULL);
			CWnd * pFloatFrame = ((CWnd *)pBar->m_pDockBar)->GetParent(); 
			ASSERT(pBar != NULL);
			arrWnd.Add(pFloatFrame);
		}
	}
}
开发者ID:Joincheng,项目名称:lithtech,代码行数:21,代码来源:FRAMEWND.CPP

示例2: GetAllInternalFiles

//----------------------------------------
void CPlotBase::GetAllInternalFiles(CObArray& allInternalFiles)
{

  CObArray::iterator itField;
  CObArray::iterator itInternalFile;

  CPlotField* field = NULL;

  for (itField = m_fields.begin() ; itField != m_fields.end() ; itField++)
  {
    field = CPlotField::GetPlotField(*itField);
    if (field == NULL)
    {
      continue;
    }
    for (itInternalFile = field->m_internalFiles.begin() ; itInternalFile != field->m_internalFiles.end() ; itInternalFile++)
    {
      CInternalFiles* f = GetInternalFiles(*itInternalFile);
      allInternalFiles.Insert(f);
    }

  }
}
开发者ID:adakite,项目名称:main,代码行数:24,代码来源:PlotBase.cpp

示例3: CXMLException

//----------------------------------------------------
void CAliasesDictionary::GetAliases(CXmlNode* parent, CObArray& arrayAliases)
{
  if (parent == NULL)
  {
    throw CXMLException("Error in CAliasesDictionary::arrayAliases - Unable to get node because parent argument is NULL", BRATHL_LOGIC_ERROR);
  }
  
  CObArray arrayNodes(false);
  
  FindAllNodesByName(CAliasesDictionary::m_ALIASES_ELT, parent, arrayNodes, true);

  CObArray::const_iterator it;

  for(it = arrayNodes.begin() ; it != arrayNodes.end() ; it++)
  {
    CXmlNode* node = dynamic_cast<CXmlNode*>(*it);
    CAliases* aliases = CreateAliases(node);
    if (aliases != NULL)
    {
      arrayAliases.Insert(aliases);
    }
  }

}
开发者ID:BRAT-DEV,项目名称:main,代码行数:25,代码来源:AliasesDictionary.cpp

示例4: CalcLoopAdjFaceNum

// 合并之后重新计算loop的邻接优先级
void CP_LoopExt::CalcLoopAdjFaceNum()
{
	CObArray tmpAdjLoopArr;

	int halfSize = GetHalfNumber();
	for(int i = 0; i < halfSize; i++)
	{
		CP_LoopExt * adjLoop = (CP_LoopExt *)GetHalf(i)->m_pTwin->m_pLoop;
		if(adjLoop->m_adjFaceNum != -1) continue;
		int j;
		for (j = 0; j < tmpAdjLoopArr.GetSize(); ++j) {
			if (tmpAdjLoopArr[j] == adjLoop)
				break;
		}
		if (j == tmpAdjLoopArr.GetSize()) tmpAdjLoopArr.Add(adjLoop);
	}
	m_adjFaceNum = tmpAdjLoopArr.GetSize();
	tmpAdjLoopArr.RemoveAll();
}
开发者ID:Nihewan,项目名称:CurveReconstruction,代码行数:20,代码来源:CP_TopologyExt.cpp

示例5: CAge

         CObArray arr;
         CAge* pa1;
         CAge* pa2;

         arr.Add(pa1 = new CAge(21)); // Element 0
         arr.Add(pa2 = new CAge(40)); // Element 1
         ASSERT(arr.GetSize() == 2);
         arr.RemoveAll(); // Pointers removed but objects not deleted.
         ASSERT(arr.GetSize() == 0);
         delete pa1;
         delete pa2;  // Cleans up memory.      
开发者ID:terryjintry,项目名称:OLSource1,代码行数:11,代码来源:cobarray-class_12.cpp

示例6: execWaitForAllChilds

int CExecCommand::execWaitForAllChilds( LPCTSTR lpstrCommand, LPCTSTR lpstrPath)
{
	CObArray		myProcessList;
	CProcessProps	*pProcess;
	DWORD			dwExitCode,
					dwProcessID,
					dwTime = 0;

	try
	{
		ASSERT( lpstrCommand);

		// Start process
		initialize();
		if ((dwProcessID = realCreateProcess( lpstrCommand, lpstrPath)) == 0) 
		{
			closeHandles();
			return EXEC_ERROR_START_COMMAND;
		}
		// We need high priority on OS to follow thread/process created by main command
		SetPriorityClass( GetCurrentProcess(), HIGH_PRIORITY_CLASS);
		// Store first process
		pProcess = new CProcessProps();
		pProcess->set( dwProcessID, GetCurrentProcessId(), lpstrCommand);
		myProcessList.Add( pProcess);
		// While there is running processes or timeout not reached
		while ((myProcessList.GetCount() > 0) && (dwTime < m_dwTimeout))
		{
			// Parse memory processes for new childs process or terminated processes
			if (!parseRunningProcesses( &myProcessList))
			{
				SetPriorityClass( GetCurrentProcess(), NORMAL_PRIORITY_CLASS);
				m_csOutput.Format( "Parse running processes Error: %s", GetAnsiFromUnicode( LookupError( GetLastError())));
				freeProcessList( &myProcessList);
				closeHandles();
				return EXEC_ERROR_WAIT_COMMAND;
			}
			Sleep( EXEC_WAIT_CHECK_LATENCY);
			dwTime += EXEC_WAIT_CHECK_LATENCY;
		}
		freeProcessList( &myProcessList);
		// Now return to normal prioity
		SetPriorityClass( GetCurrentProcess(), NORMAL_PRIORITY_CLASS);
		// Get exit code
		if (GetExitCodeProcess( m_hProcessHandle, &dwExitCode)) 
		{
			m_nExitValue = dwExitCode;
		}
		else
		{
			m_nExitValue = -1;
			m_csOutput.Format( "GetExitCode Error: %s", GetAnsiFromUnicode( LookupError( GetLastError())));
			closeHandles();
			return EXEC_ERROR_WAIT_COMMAND;
		}
		closeHandles();
		return EXEC_SUCCESSFULL;
	}
	catch (CException *pEx)
	{
		pEx->Delete();
		closeHandles();
		m_csOutput = "Unhandled exception Error";
		return EXEC_ERROR_START_COMMAND;
	}
}
开发者ID:OCSInventory-NG,项目名称:Agent-Deployment-Tool,代码行数:66,代码来源:ExecCommand.cpp

示例7: ASSERT

// **************************************************************************
// WorkerThread ()
//
// Description:
//	Worker thread function.
//
// Parameters:
//	void		*pvArgs		Pointer to a WORKERTHREADARG structure which
//							  describes task to be performed.
//
// Returns:
//  unsigned int - 0
// **************************************************************************
unsigned _stdcall CKDocument::WorkerThread (void *pvArgs)
	{
	// Cast argument to proper type so we can extract the required data
	// about the task we are to perform:
	WORKERTHREADARG *pWTA = (WORKERTHREADARG *)pvArgs;
	ASSERT (pWTA);

	// Execute specified task:
	switch (pWTA->eTask)
		{
		case WORKERTHREADARG::START_SINGLE_SERVER:
		case WORKERTHREADARG::STOP_SINGLE_SERVER:
			{
			// Extract pointer to server we are to start or stop from
			// argument structure:
			CKServer *pServer = (CKServer *)pWTA->pvObjectA;
			ASSERT (pServer);

			// Start or stop the server as the case may be:
			if (pWTA->eTask == WORKERTHREADARG::START_SINGLE_SERVER)
				pServer->Start ();
			else
				pServer->Stop ();
			}
			break;

		case WORKERTHREADARG::START_MULTIPLE_SERVER:
		case WORKERTHREADARG::STOP_MULTIPLE_SERVER:
			{
			// Extract the list (object array) of servers to start or stop 
			// from argument structure:
			CObArray *pList = (CObArray *)pWTA->pvObjectA;
			ASSERT (pList);

			// Get the number of server in the list:
			int cnServers = pList->GetSize ();
			CKServer *pServer = NULL;

			// Loop over the servers in the list:
			while (--cnServers >= 0)
				{
				// Get pointer to next server in list:
				pServer = (CKServer *) pList->GetAt (cnServers);
				ASSERT (pServer);

				// Start or stop that server as the case may be:
				if (pWTA->eTask == WORKERTHREADARG::START_MULTIPLE_SERVER)
					pServer->Start ();
				else
					pServer->Stop ();
				}
			}
			break;

		case WORKERTHREADARG::ADD_ITEMS:
			{
			// Extract the list (object array) of items to add from
			// argument structure:
			CObArray *pList = (CObArray *)pWTA->pvObjectA;
			ASSERT (pList);

			// Extract the number of items from the argument structure:
			int cnItems = *(int *)pWTA->pvObjectB;

			// Get pointer to first item from list.  We will use it to
			// get the group object these items will be added to:
			CKItem *pItem = (CKItem *)pList->GetAt (0);
			ASSERT (pItem);

			// Get group that we are adding the items to:
			CKGroup *pGroup = pItem->GetParentGroup ();
			ASSERT (pGroup);

			// Add the items to this group:
			pGroup->AddItems (*pList, cnItems);
			}
			break;

		default:
			// unhandled task ?
			ASSERT (FALSE);
			break;
		}

	return (0);
	}
开发者ID:wfmdyh,项目名称:wecan,代码行数:99,代码来源:document.cpp

示例8: return

// **************************************************************************
// 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

示例9: TRACE1

/**
* OnLoadUrl
*
* Description: Load a url into the view
*
* Parameters:	wparam: - 0 = no callback, 1 = yes callback
*				lparam: CString url path
*/
LRESULT CMainFrame::OnLoadUrl(WPARAM wParam, LPARAM lParam)
{
	CConnectionListView * connectionView = (CConnectionListView *)m_mainSplitter.GetPane(0,0);
	CFileListView * fileListView = (CFileListView *)m_mainSplitter.GetPane(0,1);

	CString * urlArg = (CString*)lParam;
	if(urlArg){
		TRACE1(" Load url: %s \n", urlArg->AllocSysString());
		CString url(urlArg->AllocSysString());
		delete urlArg;

		CString host(_T(""));
		CString dir(_T(""));
		// Parse
		if(url.Find(_T("ftp://")) != -1){
			url = url.Mid(url.Find(_T("ftp://")) + 6, url.GetLength() - url.Find(_T("ftp://")));
		}
		int pos = url.Find('/');
		if(pos != -1){
			host = url.Mid(0, pos);
			dir = url.Mid(pos, url.GetLength() - pos);
		} else {
			host = CString(url);
			dir = CString(_T("/"));
		}

		// select connection
		int connection_id = -1;
		CObArray * listOfConnections;
		listOfConnections = m_connectionManager.GetConnections();
		int i = 0;
		for(i = 0; i < listOfConnections->GetSize(); i++){
			CConnection * con = (CConnection *)listOfConnections->GetAt(i);
			if(con->host.Compare(host) == 0){
				connection_id = i;
				connectionView->SelectConnection(connection_id);
			}
		}

		// Prompt for new connection information
		if(connection_id < 0){
			CConnectionDialog dlg;
			dlg.SetHost(host); // prefill in host
			dlg.DoModal();
	
			// Update view with updated connections
			connectionView->UpdateConnections();

			// Re check host in connections
			m_connectionManager.Load();
			listOfConnections = m_connectionManager.GetConnections();
			int i = 0;
			for(i = 0; i < listOfConnections->GetSize(); i++){
				CConnection * con = (CConnection *)listOfConnections->GetAt(i);
				if(con->host.Compare(host) == 0){
					connection_id = i;
					connectionView->SelectConnection(connection_id);
				}
			}
			if(connection_id < 0){
				return 1; // No connection entered, abort
			}
		}

		// Load file list view
		fileListView->LoadServerConnection(connection_id);
		fileListView->LoadDirectory(dir);

		// Load url in header history.
		if(m_headerDoc && ((int)wParam) == 1){
			m_headerDoc.SetUrl( CString(host + dir) );
			m_headerDoc.SetConnectionID(connection_id); 
			m_headerDoc.m_path = CString(dir);          // This needs work
			CFileListView * v = (CFileListView *)m_mainSplitter.GetPane(0,1);
			m_headerDoc.m_path = CString(v->GetPath());
		}

		// Cleanup
		delete urlArg;
	}
	return 1;
}
开发者ID:Omgan,项目名称:RealFTP.net,代码行数:90,代码来源:MainFrm.cpp

示例10: MAKEINTRESOURCE


//.........这里部分代码省略.........
	//m_wndStatusBar.SetIndicators(indicators, sizeof(indicators)/sizeof(UINT));
	

	// TODO: Delete these five lines if you don't want the toolbar and menubar to be dockable
	//m_wndMenuBar.EnableDocking(CBRS_ALIGN_ANY);
	//m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
	EnableDocking(CBRS_ALIGN_ANY);   // required or won't show toolbar
	DockPane(&m_wndMenuBar);
	//DockPane(&m_wndToolBar);
	DockPane(&m_headerDoc);

	// Bottom pane
	//m_footerPane.EnableDocking(CBRS_ALIGN_BOTTOM);
	//DockPane(&m_footerPane, AFX_IDW_DOCKBAR_BOTTOM);

	//m_wndToolBar.ShowPane(SW_SHOW,0,0);
	//m_wndToolBar.SetWi

	// enable Visual Studio 2005 style docking window behavior
	//CDockingManager::SetDockingMode(DT_SMART);
	// enable Visual Studio 2005 style docking window auto-hide behavior
	EnableAutoHidePanes(CBRS_ALIGN_ANY);

	// Enable toolbar and docking window menu replacement
	//EnablePaneMenu(TRUE, ID_VIEW_CUSTOMIZE, strCustomize, ID_VIEW_TOOLBAR);

	// enable quick (Alt+drag) toolbar customization
	//CMFCToolBar::EnableQuickCustomization();

	if (CMFCToolBar::GetUserImages() == NULL)
	{
		// load user-defined toolbar images
		if (m_UserImages.Load(_T(".\\UserImages.bmp")))
		{
			CMFCToolBar::SetUserImages(&m_UserImages);
		}
	}

	// enable menu personalization (most-recently used commands)
	// TODO: define your own basic commands, ensuring that each pulldown menu has at least one basic command.
	CList<UINT, UINT> lstBasicCommands;

	lstBasicCommands.AddTail(ID_APP_EXIT);
	lstBasicCommands.AddTail(ID_EDIT_CUT);
	lstBasicCommands.AddTail(ID_EDIT_PASTE);
	lstBasicCommands.AddTail(ID_EDIT_UNDO);
	lstBasicCommands.AddTail(ID_APP_ABOUT);
	lstBasicCommands.AddTail(ID_VIEW_STATUS_BAR);
	//CMFCToolBar::SetBasicCommands(lstBasicCommands);


	// Display New Connection Dialog if no connections exist
	m_connectionManager.Load();
	CObArray * listOfConnections;
	listOfConnections = m_connectionManager.GetConnections();
	int connectionCount = listOfConnections->GetSize();
	if(connectionCount == 0)
	{
		PostMessage( WM_COMMAND, ID_NEW_CONNECTION_MENU_ITEM, 0 );
	}

	// Start sync thread
	//
	//m_ftpManager.SyncServerConnections();
	THREADPARAM * _param = new THREADPARAM;
	_param->m = this;
	// THREAD_PRIORITY_IDLE   THREAD_PRIORITY_LOWEST
	m_pFtpSyncThread = AfxBeginThread(CMainFrame::FtpSyncWorker, &_param, THREAD_PRIORITY_LOWEST); //, THREAD_PRIORITY_NORMAL, 0, CREATE_SUSPENDED);
	if (m_pFtpSyncThread != NULL)
	{
		//TRACE(_T("AfxBeginThread: 0x%08lX\n"), m_pFtpSyncThread->m_nThreadID);
	}


	// Start Ad manager
	//m_wndMenuBar.m_ad = m_ad;
	//m_ad.Start();
	

	// Create tray icon.
	LoadTrayIcon();

	// Check for an update
	CUpgrade update;
	update.CheckForUpgrade();

	// Hostory
	m_historyDlg = new CHistoryDialog(this);
	m_historyDlg->Create(CHistoryDialog::IDD, GetDesktopWindow());
	
	// Registry - GUID
	//CRegistry reg;
	//bool p = reg.IsPurchased();
	//reg.Purchase();
	//p = reg.IsPurchased();
	//CString guid(_T(""));
	//reg.GetGUID(guid);

	return 0;
}
开发者ID:Omgan,项目名称:RealFTP.net,代码行数:101,代码来源:MainFrm.cpp

示例11: DeleteArray

void CHTMLFont::DeleteArray(CObArray & arrArray)
{
    for ( int nObj=0; nObj < arrArray.GetSize(); nObj++)
        delete (CHTMLFont *) arrArray[nObj];
    arrArray.RemoveAll();
}
开发者ID:kernelbitch,项目名称:construct,代码行数:6,代码来源:HTMLFont.cpp

示例12: _T

void CDialogPlacePart::DoImportLibrary()
{
	CDraftDrawDoc *pDoc = theApp.GetActiveDocument();

	std::wstring sFilter = _T("External library file (*.xml)|*.xml||");//All Files (*.*)|*.*||;
	CStringArray saExtensions;
	saExtensions.Add(_T("xml"));

	CFileDialog fdialog(
		TRUE,		//save dialog box
		NULL,
		NULL,
		0,			//no flags
		sFilter.c_str(),
		NULL);

	if (fdialog.DoModal() == IDOK){

		//Get filename from dialog
		int offset = fdialog.m_ofn.nFileExtension;
		CString strFile = fdialog.m_ofn.lpstrFile;
		int nFilterIndex = fdialog.m_ofn.nFilterIndex;
		if ((!offset) || (fdialog.m_ofn.lpstrFile[offset] == 0)){

			strFile += _T(".") + saExtensions[fdialog.m_ofn.nFilterIndex - 1];
			sFilter = saExtensions[fdialog.m_ofn.nFilterIndex - 1];
		}

		//Try to import library
		CImporter *pImporter = new CImporter();
		CObArray *pObArray = new CObArray();
		pImporter->ImportLibrary(strFile, pObArray, pDoc->m_szGrid);

		//Create new library
		CString strLib = strFile.Left(strFile.ReverseFind('.'));
		if (strLib.ReverseFind(_T('\\')) >= 0){
			strLib = strLib.Right(strLib.GetLength() - strLib.ReverseFind(_T('\\')) - 1);
		}
		if (strLib.GetLength() == 0) strLib = strFile;
		DoInsertNewLibrary(strLib, TRUE);

		//Iterate all shapes to bounding rect union
		CRect rectUnion;
		for (int i = 0; i < pObArray->GetSize(); i++){
			CShapeUnit *pSh = (CShapeUnit *)pObArray->GetAt(i);
			CRect rect;
			pSh->GetRectTemp(rect);

			TRACE(_T("Importing part %s.\n"),(LPCTSTR)(pSh->m_sUnitName));

			//rectUnion.UnionRect(rectUnion, rect);
			if (rect.Width()>rectUnion.Width()){
				rectUnion = CRect(CPoint(0, 0), CSize(rect.Width(), rectUnion.Height()));
			}
			if (rect.Height()>rectUnion.Height()){
				rectUnion = CRect(CPoint(0, 0), CSize(rectUnion.Width(), rect.Height()));
			}
		}

		//rectUnion.InflateRect(DCABLE_PADDINGX_DEFAULT << 1, DCABLE_PADDINGY_DEFAULT << 1);
		rectUnion.InflateRect(DCABLE_GRIDX_DEFAULT, DCABLE_GRIDY_DEFAULT);
		CSize size=rectUnion.Size();
		rectUnion = CRect(CPoint(0, 0), rectUnion.Size());

		//Insert/update parts
		for (int i = 0; i<pObArray->GetSize(); i++){

			//Insert part
			CShapeUnit *pSh = (CShapeUnit *)pObArray->GetAt(i);

			//Do insert in librarry
			DoInsertPart(pSh->m_sUnitName);

			//Get bounding rect
			CRect rectTemp;
			pSh->GetRectTemp(rectTemp);
			((CShapeFrmRect*)pSh->m_obarrShapearr[0])->m_Rect = rectUnion;
			CPoint offset = CPoint((rectUnion.Width() - rectTemp.Width()) >> 1, (rectUnion.Height() - rectTemp.Height()) >> 1);

			//Call a method to normalize ShapeUnit from bounding rect TopLeft to (0,0) or any other offset
			//pSh->NormalizeChildShapes(CPoint(DCABLE_PADDINGX_DEFAULT, DCABLE_PADDINGY_DEFAULT));
			pSh->NormalizeChildShapes(offset);

			//Save parts
			//Create new method in CDocument to be called from here and serialize the parts
			CString strFile = pSh->m_sUnitName;
			//Keep previous part edition status
			BOOL bFlagPartEdit = pDoc->m_bFlagPartEdit;
			//Set part edition mode to save the save
			pDoc->m_bFlagPartEdit = TRUE;
			CObArray* prevObArray = pDoc->m_pObArray;
			pDoc->m_pObArray = &pSh->m_obarrShapearr;
			pDoc->OnDatabaseSave(strLib + _T(".") + strFile);
			pDoc->m_pObArray = prevObArray;
			//Restore flag
			pDoc->m_bFlagPartEdit = bFlagPartEdit;
		}

	}//End dialog result OK
开发者ID:jcampos73,项目名称:DraftCable,代码行数:99,代码来源:DialogPlacePart.cpp

示例13: GetContacts

BOOL CExMapi::GetContacts(CObArray& contactArray,CTRError& error)
{
	BOOL doLog = m_pCtrl->IsEnableLog();
	if(doLog)
	{
		m_logHelper.LogPAB(L"------------------------------------");
		m_logHelper.LogPAB(L"Function GetPABCotacts START:");
		m_logHelper.LogPAB(L"------------------------------------");
	}

	CString strFilterBy = m_pCtrl->GetPABSerachBy();
	CString strStartWith = m_pCtrl->GetPABSerachStartWith();
	strStartWith = strStartWith.MakeLower();
	ULONG pageSize;
	m_pCtrl->get_PABPageSize(&pageSize);
	ULONG pageNumber = m_pCtrl->GetPABPageNumber();
	LONG contactCount = 0;
	LONG skipCount = 0;
	LONG startIndex = -1;
	LONG contactIndex = 0;
	LONG folderCount = 0;
	if(pageSize>0)
	{
		startIndex = (pageSize * pageNumber) - pageSize;
	}

	CString strFolder;
	int msgStoreCount = 0;
	wchar_t buffer[5];

	LPMAPIFOLDER pSubFolder=NULL;	
	LPMAPITABLE lpMsgStoreTable = NULL;
	lpMsgStoreTable = GetMessageStoresTable();	
	if(lpMsgStoreTable)
	{
		while(OpenNextMessageStore(lpMsgStoreTable))
		{	
			//GetContacts(OpenRootFolder(),folderCount,contactCount,skipCount,contactIndex,contactArray);

			msgStoreCount++;
			_itow(msgStoreCount,buffer,10);
			if(doLog)
			{
				if(msgStoreCount > 1)
					m_logHelper.LogPAB(L"-------------------------------------");
				m_logHelper.LogPAB(L"Message Store No : "+CString(buffer));
				m_logHelper.LogPAB(L"-------------------------------------");
			}

			pSubFolder = OpenContacts();
			if(pSubFolder && IsContactFolder(pSubFolder))
			{
				if(doLog)
					m_logHelper.LogPAB(L"Open Main Contacts Folder");

				strFolder = GetFolderName(pSubFolder);
				folderCount++;
				if(GetContents(pSubFolder))
				{
					SortContents(TABLE_SORT_ASCEND,PR_DISPLAY_NAME);
					//SortContents(TABLE_SORT_ASCEND,PR_SUBJECT);

					CString strText;
					CExMapiContact mapiContact;
					CString name;
					CString email;
					BOOL mustFilter = FALSE;
					mustFilter = strStartWith != "";
					
					if(doLog)
						m_logHelper.LogPAB(L"Start reading contacts from main contact fodler");

					while(GetNextContact(mapiContact) && !m_pCtrl->IsPABSearchAbort()) 
					{
						if(pageSize > 0)
						{
							if(contactCount == pageSize)
							{
								break;								
							}
						}

						contactIndex++;
						if(mustFilter)
						{
							if(strFilterBy == "Name")
							{
								mapiContact.GetName(name,PR_GIVEN_NAME);
								name = name.MakeLower();
								if(name.Find(strStartWith) != 0)				
								{
									continue;									
								}
							}

							if(strFilterBy == "Email")
							{
								mapiContact.GetEmail(email);
								email = email.MakeLower();
								if(email.Find(strStartWith) != 0)
//.........这里部分代码省略.........
开发者ID:whyzgeek,项目名称:MS-OutLook-ContactsImporter,代码行数:101,代码来源:ExMapi.cpp

示例14:

extern "C" DWORD PASCAL EXPORT STDFUFILES_GetImageNbElement(HANDLE Handle, PDWORD pNbElements)
{
	AFX_MANAGE_STATE(AfxGetStaticModuleState());

	BOOL bFound=FALSE;
	DWORD dwRet=STDFUFILES_NOERROR;

	for (int i=0;i<=g_Images.GetUpperBound();i++)
	{
		if ((HANDLE)g_Images.GetAt(i)==Handle)
		{
			CImage *pImage=(CImage *)Handle;
			
			bFound=TRUE;
			*pNbElements=pImage->GetNbElements();
			break;
		}
	}

	if (!bFound)
		dwRet=STDFUFILES_BADPARAMETER;
	return dwRet;
}
开发者ID:tianxq,项目名称:fly_controller,代码行数:23,代码来源:STDFUFiles.cpp

示例15: CImage

extern "C" DWORD PASCAL EXPORT STDFUFILES_CreateImageFromMapping(PHANDLE pHandle, PMAPPING pMapping)
{
	AFX_MANAGE_STATE(AfxGetStaticModuleState());

	DWORD Ret=STDFUFILES_BADPARAMETER;

	CImage *pImage=new CImage(pMapping, FALSE, NULL);
	if (pImage)
	{
		g_Images.Add(pImage);
		*pHandle=(HANDLE)pImage;
		Ret=STDFUFILES_NOERROR;
	}
	return Ret;
}
开发者ID:tianxq,项目名称:fly_controller,代码行数:15,代码来源:STDFUFiles.cpp


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