#include "stdafx.h"
#include "2CntrItem.h"		// For CMolipDrawCntrItem.
#include "2ObjOle.h"		// This header.

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

#ifdef SUPER_CLASS
#undef SUPER_CLASS
#endif
#define SUPER_CLASS MC2ObjBase

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	MC2ObjOle::MC2ObjOle
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDfCiDjDiDfIiDgHiDiJiDeOiDfOiBeC_xHqqkZx_FDFoundDoc_xZkqqHx_iCmM_xHqqkZx_InStream_xZkqqHx_iCmFjFeLjHhGiBeC_xHqqkZx_
 *************************************************************************/
MC2ObjOle::MC2ObjOle ()
{
	m_pOleItem = NULL;
	m_mmrtResize.SetRect(0, 0, 100, 100);
} // MC2ObjOle::MC2ObjOle.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	IsKindOf
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_jFjEjFgJiCkKiClBiCmMiMfOiBeBiIlNiCkCiCmNiClBiCmMiMfOiCmMiDfEiDhFiDeOiDiJiDfIiCmMiMfOiCkJiCmHiCkEiCkJiCpAjClCiCnHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	nType	: _xZkqqHx_jClCiCnHiCoJiMfOiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	TRUE	: nType_xZkqqHx_iMfOiBeBiIlNiCkCiCmNiClLiCmMiDfEiDhFiDeOiDiJiDfIiCmMiPoKiNiH_xHqqkZx_
 *			FALSE	: _xZkqqHx_iClLiCkEiCmFiCmIiCkCiPoKiNiH_xHqqkZx_
 *************************************************************************/
BOOL MC2ObjOle::IsKindOf (FTObjectType nType) const
{
	if (nType == FDOJ_OLE) return TRUE;
	return SUPER_CLASS::IsKindOf(nType);
} // MC2ObjOle::IsKindOf.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	MC2ObjOle::Type
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iClBiCmMiDeOiDiJiDfIiCmMiMfOiCpAjFnEiClH_xHqqkZx_.
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iDeOiDiJiDfIiCmMiMfO_xHqqkZx_
 *************************************************************************/
FTObjectType MC2ObjOle::Type () const
{
	return FDOJ_OLE;
}

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	MC2ObjOle::OutStream
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_jFjEjFgJiCmMiPpDjBnEiCpAiDfIiDgHiDiKiBfLiDiAiCmJiPjBiCkLiPgPiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	ar	: _xZkqqHx_iPjBiCkLiPgPiClFjHhAiCmM_xHqqkZx_MC2ARCHIVE
 *
 * <_xZkqqHx_jCiNiInD_xHqqkZx_>	m_pOleItem_xZkqqHx_iCmNiDfGiDiKiDeBiDiJiDeDiDfJiCmMjFeLjHhGiCmNiCmIiCkCiBeCjDmHiCnNiNjOiCnNiOjOiCmJiCmNiBeB_xHqqkZx_
 *			Document_xZkqqHx_iCmMiDfGiDiKiDeBiDiJiDeDiDfJiCmFjAnNjCoIiClFiCmEiCkNiCoKiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	99.03.03 Fukushiro M. MC2ARCHIVE_xZkqqHx_iCpA_xHqqkZx_MC2ARCHIVE_xZkqqHx_iCmJiPeDjAlDiBeC_xHqqkZx_
 *************************************************************************/
void MC2ObjOle::OutStream (MC2ARCHIVE& ar)
{
	SUPER_CLASS::OutStream(ar);
	ar << m_mmrtResize;		// _xZkqqHx_iDiKiDfEiDeDiDfJiDhEiDiMiBfLiDiAiBeC_xHqqkZx_
//	ar << *m_pOleItem;		// OLE_xZkqqHx_iDeJiDhFiDfHiDeGiDeOiDgHiBeC_xHqqkZx_
} // MC2ObjOle::OutStream.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	MC2ObjOle::InStream
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_jFjEjFgJiCmMiPpDjBnEiCpAiDfIiDgHiDiKiBfLiDiAiCkJiCoHjDmHiCnNiNjOiCnOiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	ar	: _xZkqqHx_jDmHiCnNiNjOiCnNjHhAiCmM_xHqqkZx_MC2ARCHIVE
 *
 * <_xZkqqHx_jCiNiInD_xHqqkZx_>	m_pOleItem_xZkqqHx_iCmNiDfGiDiKiDeBiDiJiDeDiDfJiCmMjFeLjHhGiCmNiCmIiCkCiBeCjDmHiCnNiNjOiCnNiOjOiCmJiCmNiBeB_xHqqkZx_
 *			Document_xZkqqHx_iCmMiDfGiDiKiDeBiDiJiDeDiDfJiCmFjAnNjCoIiClFiCmEiCkNiCoKiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	99.03.03 Fukushiro M. MC2ARCHIVE_xZkqqHx_iCpA_xHqqkZx_MC2ARCHIVE_xZkqqHx_iCmJiPeDjAlDiBeC_xHqqkZx_
 *************************************************************************/
void MC2ObjOle::InStream (MC2ARCHIVE& ar)
{
	SUPER_CLASS::InStream(ar);
	ar >> m_mmrtResize;		// _xZkqqHx_iDiKiDfEiDeDiDfJiDhEiDiMiBfLiDiAiBeC_xHqqkZx_
//	ar >> *m_pOleItem;		// OLE_xZkqqHx_iDeJiDhFiDfHiDeGiDeOiDgHiBeC_xHqqkZx_
} // MC2ObjOle::InStream.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	MC2ObjOle::~MC2ObjOle
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDgGiDfIiDgHiDiJiDeOiDfOiBeC_xHqqkZx_
 *************************************************************************/
MC2ObjOle::~MC2ObjOle ()
{
	if (m_pOleItem != NULL)
	{
		// _xZkqqHx_iClBiClBiCmFiBeB_xHqqkZx_m_pOleItem->Delete();_xZkqqHx_iCpAiOmAiNhDiClFiClNiCkCiCmMiClOiCkKiBeBiClLiCkEiClHiCoJiCmG_xHqqkZx_
		// Molip_xZkqqHx_iCpA_xHqqkZx_OLE_xZkqqHx_iCmGiClFiCmEiDhJiBfLiDfIiDgHiClFiClNjAoGiCmMiDeBiDhGiDiKiCkJiCoHiBeB_xHqqkZx_Molip_xZkqqHx_iNmEjFnCiPfHiCkK_xHqqkZx_
		// _xZkqqHx_iCmFiCkLiCmIiCkNiCmIiCmBiCmEiClFiCnMiCkEiBeC_xHqqkZx_
		// OLE_xZkqqHx_iCmMiDfDiDhOiCmNiOgDiCoJiCkKiBeBiJoEjGjNiBeC_xHqqkZx_

		// OleClientItem_xZkqqHx_iCmJiBeBjGlDiMpIiCmM_xHqqkZx_ObjID_xZkqqHx_iCpAjAnNjCoIiClHiCoJiBeC_xHqqkZx_
		m_pOleItem->SetOwnerObjectID(DWORD(-1));
		m_pOleItem = NULL;
	}
} // MC2ObjOle::~MC2ObjOle.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	MC2ObjOle::SetOleClientItem
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	OLE_xZkqqHx_iDeBiDeDiDgFiDiAiCpAjAnNjCoIiClHiCoJ_xHqqkZx_.
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	pItem	:OLE_xZkqqHx_iDeBiDeDiDgFiDiA_xHqqkZx_
 *
 * <_xZkqqHx_jCiNiInD_xHqqkZx_>	OLE_xZkqqHx_iDeBiDeDiDgFiDiAiCmNiBeBiDfCiDhDiBfLiCpAiCmGiCoHiClIiCmJiClLiCmMiCnMiCnMjDoAjFjEiCmFiOgHjHhAiClDiCoKiCoJiBeC_xHqqkZx_
 *************************************************************************/
void MC2ObjOle::SetOleClientItem (CMolipDrawCntrItem* pItem)
{
	m_pOleItem = pItem;
} // MC2ObjOle::SetOleClientItem.

