ホーム » 2017 » 10月 » 31

日別アーカイブ: 2017/10/31

2017年10月
1234567
891011121314
15161718192021
22232425262728
293031  

カテゴリー

アーカイブ

ブログ統計情報

  • 79,911 アクセス



CObArray <--> CObList

CObList の形式のデータを配列として処理したかったので,その相互変換(Sort_ind.hxx 内).


#ifdef		_MFC_VER
//*******************************************************************************
//	ObList	->	ObArray
//	Create	:	2017/10/30
//*******************************************************************************
inline	bool	To_ObArray	(const CObList& src,CObArray* dstAry)
{
	if (dstAry == NULL)		{	return	false ;		}
	dstAry->RemoveAll() ;
	{
		POSITION pos = src.GetHeadPosition();
		while (pos != NULL)	{
			CObject*	pObj = src.GetNext(pos);
			dstAry->Add(pObj) ;
			}
		}
	return	true ;
	}

//*******************************************************************************
//	ObArray	->	ObList
//	Create	:	2017/10/30
//*******************************************************************************
inline	bool	To_ObList	(const CObArray& src,CObList* dstLst)
{
	if (dstLst == NULL)		{	return	false ;		}
	dstLst->RemoveAll() ;
	{
		for (INT_PTR index=0 ; index<src.GetSize() ; index++) {
			CObject*	pObj = src[index] ;
			dstLst->AddTail(pObj) ;
			}
		}
	return	true ;
	}

#endif	//	_MFC_VER
Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.