// SrvrItem.cpp : CFCMolipDrawSrvrItem _xZkqqHx_iDeBiDhGiDiKiDfAiBfLiDfGiDiHiDjDjHhAiDeOiDiJiDfIiCmMiLeAjEfMjCoIiLgAiCpAiNhDiCkCiCnMiClHiBeC_xHqqkZx_
//

#include "stdafx.h"
#include "DynamicDraw.h"
#include <float.h>			// For DBL_MAX.
#include <afxadv.h>			// For CSharedFile.
#include "FoundDoc.h"		// For g_pDoc.
#include "RegData.h"		// For FCRegData.
#include "LayerManager.h"	// For FDOZ_ON_ANY.
#include "ZOrder.h"			// For FCZOrder.
#include "ObjDynabase.h"		// For GetOuterFrame.
#include "DynamicDrawView.h"	// For SelectObjVector.
#include "LinkManager.h"	// For LinkManager();
#include "SheetManager.h"	// For SheetManager();
#include "UtilCoord.h"		// For mm2lg.etc.
#include "UtilDlg.h"		// For FFShowMsgPanel.
#include "UtilStr.h"		// For FormatResString.
#include "SrvrItem.h"		// This header.

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

/////////////////////////////////////////////////////////////////////////////
// CFCMolipDrawSrvrItem _xZkqqHx_iDeDiDjDiDhGiDiKiDiBiDjDiDgFiBfLiDfGiDiHiDjD_xHqqkZx_

IMPLEMENT_DYNAMIC(CFCMolipDrawSrvrItem, COleServerItem)

// 03.08.31 Fukushiro M. 1_xZkqqHx_iNhDjFmPiNfI_xHqqkZx_ ()
//CFCMolipDrawSrvrItem::CFCMolipDrawSrvrItem (CFCFoundDoc* pContainerDoc)
CFCMolipDrawSrvrItem::CFCMolipDrawSrvrItem (COleServerDoc* pContainerDoc)
	: COleServerItem(pContainerDoc, TRUE)
{
	// _xZkqqHx_iKpJiCmJjAnNjCoIiClDiCoKiCmEiCkCiCoJiDgGiBfLiDfOiDfMiBfLiDfIiBgJ_xHqqkZx_CF_METAFILEPICT_xZkqqHx_iBgKiCpAjGjFiPmBiBeC_xHqqkZx_
	// CF_METAFILEPICT_xZkqqHx_iCoGiCoIjAoGiCmJ_xHqqkZx_CF_ENHMETAFILE_xZkqqHx_iCpAjDgPjIfOiClHiCoJiClNiCnPiBeC_xHqqkZx_
	// EMF_xZkqqHx_iCpAjAoGiCmJjDgPjIfOiClFiCmIiCkCiCmGiBeB_xHqqkZx_MS-WORD_xZkqqHx_iCmFiMgAiOkOiOhHjCoIjDfMiCoIjFhEiCkPiCmM_xHqqkZx_EMF_xZkqqHx_iCkKjGlDiMpIiCmJ_xHqqkZx_
	// _xZkqqHx_iCmIiCmBiCmEiClFiCnMiCkEiClNiCnPiBeC_xHqqkZx_
	GetDataSource()->Empty();
	//----- _xZkqqHx_iDgGiBfLiDfOiDfMiBfLiDfIiCmJ_xHqqkZx_ EMF _xZkqqHx_iCpAjDgPjIfO_xHqqkZx_ -----
	FORMATETC formatEtc;
	formatEtc.ptd = NULL;
	formatEtc.dwAspect = DVASPECT_CONTENT;
	formatEtc.lindex = -1;
	formatEtc.cfFormat = CF_ENHMETAFILE;
	formatEtc.tymed = TYMED_ENHMF;
	GetDataSource()->DelayRenderData(0, &formatEtc);
	//----- _xZkqqHx_iDgGiBfLiDfOiDfMiBfLiDfIiCmJ_xHqqkZx_ Metafile _xZkqqHx_iCpAjDgPjIfO_xHqqkZx_ -----
	FORMATETC formatEtc2;
	formatEtc2.ptd = NULL;
	formatEtc2.dwAspect = DVASPECT_CONTENT;
	formatEtc2.lindex = -1;
	formatEtc2.cfFormat = CF_METAFILEPICT;
	formatEtc2.tymed = TYMED_MFPICT;
	GetDataSource()->DelayRenderData(0, &formatEtc2);

//----- 00.08.28 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
//	//----- _xZkqqHx_iDiGiBfLiDfFjFmPjAjEiCpAiPiJiKpKiJlL_xHqqkZx_ -----
//	m_nResolution = 0;	// _xZkqqHx_iJpAjBjMjDhIiCmMiPiJiKpKiJlLiBeC_xHqqkZx_
//----- 00.08.28 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----
} // CFCMolipDrawSrvrItem::CFCMolipDrawSrvrItem.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCMolipDrawSrvrItem::OnRenderData
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_jChIiJiEiDiMiDjDiDfPiDiKiDjDiDePiCmMiIoKjFjEiCmGiClFiCmEiDgGiBfLiDfOiCpAiOoGjDlOiClHiCoJiBeC_xHqqkZx_
 *			EMF_xZkqqHx_iDgGiBfLiDfOiCpAiOoGjDlOiClHiCoJiClNiCnPiCmJiDeJiBfLiDgPiBfLiDiJiDeDiDgIiClFiClNiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	lpFormatEtc	:_xZkqqHx_iPoOjFpBiCkKjHhGiLiBiClDiCoKiClNiMgAiOkOiCpAiOhHjCoIiClHiCoJ_xHqqkZx_FORMATETC_xZkqqHx_iNfMjBkCjBmMiCmM_xHqqkZx_
 *						 _xZkqqHx_iDhMiDeDiDjDiDfOiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 *			lpStgMedium	:_xZkqqHx_iDgGiBfLiDfOiCkKjFnEiClDiCoKiCoJ_xHqqkZx_STGMEDIUM_xZkqqHx_iNfMjBkCjBmMiCnGiCmMiDhMiDeDiDjDiDfOiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_jAlDiPoNiPeJjHlJiClFiClNiPoKiNiHiCmN_xHqqkZx_ 0 _xZkqqHx_iImIiKePiCpAjFnEiClFiCnMiClHiBeCiClLiCoKiImIiKePiCmMiPoKiNiHiCmN_xHqqkZx_ 0 _xZkqqHx_iCpAjFnEiClFiCnMiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	00.03.31 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
BOOL CFCMolipDrawSrvrItem::OnRenderData (LPFORMATETC lpFormatEtc, LPSTGMEDIUM lpStgMedium)
{
	if (lpFormatEtc->cfFormat == CF_ENHMETAFILE)
		return GetEnhancedMetafileData(lpFormatEtc, lpStgMedium);
	// EMF_xZkqqHx_iImIiKePiCmMiPoKiNiHiCmN_xHqqkZx_Superclass_xZkqqHx_iKnGjAjEiOmAiNhDiBeC_xHqqkZx_
	return COleServerItem::OnRenderData(lpFormatEtc, lpStgMedium);
} // CFCMolipDrawSrvrItem::OnRenderData.

//----- 00.08.28 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
///*************************************************************************
// * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCMolipDrawSrvrItem::SetMetaResolution
// *
// * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDiBiDfOiDhEiDeAiDeDiDiLiCmMiJpAjBjMjDhIiCpAiOhHjCoIiClHiCoJiBeC_xHqqkZx_
// *
// * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	nResolution	:_xZkqqHx_iJpAjBjMjDhIiCpAiOhHjCoIiBeC_xHqqkZx_
// *
// * <_xZkqqHx_iJpAjAoA_xHqqkZx_>	0 _xZkqqHx_iCpAiOhHjCoIiClHiCoJiCmGiBeBjCmKiPoNiCmMiDfCiDhDiBfLiBeC_xHqqkZx_1_xZkqqHx_iImIiPoDiCpAiOhHjCoIiClHiCoJiCmGiBeBiOhHjCoIiJpAjBjMjDhIiCmF_xHqqkZx_
// *			_xZkqqHx_iDiBiDfOiDhEiDeAiDeDiDiLiCmMiCnNiCmMiDfCiDhDiBfLiCpAiOmAiNhDiBeC_xHqqkZx_
// *			_xZkqqHx_iIoKiJpBiDfCiDhDiBfLiClHiCoJiClNiCnBiCmJ_xHqqkZx_ 0 _xZkqqHx_iCmJiDiKiDfKiDgCiDgHiClDiCoKiCoJiBeC_xHqqkZx_
// *
// * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	00.08.27 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
// *************************************************************************/
//void CFCMolipDrawSrvrItem::SetMetaResolution (short nResolution)
//{
//	m_nResolution = nResolution;
//} // CFCMolipDrawSrvrItem::SetMetaResolution.
//----- 00.08.28 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----

/*************************************************************************
 * <_xZkqqHx_iNfMjBkCjBmM_xHqqkZx_>	APMHEADER
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	Aldus Placeable Metafile (APM) _xZkqqHx_iCmMiDhHiDgCiDfPiNfMjBkCjBmMiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iPnKiNnH_xHqqkZx_>	CFCMolipDrawSrvrItem::SaveSelectedWMF _xZkqqHx_iCpAiOfBiPmGiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jCiNiInD_xHqqkZx_>	16Bit_xZkqqHx_iOjOjBoDiCmMiNfMjBkCjBmMiCmIiCmMiCmFiBeBiCfBiDgPiDeDiDgHiCmFiDeBiDiJiDeDiDjDiDiBiDjDiDgHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	01.08.31 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
#pragma pack( push )
#pragma pack( 2 )
typedef struct
{
	DWORD		dwKey;
	WORD		hmf;
	SMALL_RECT	bbox;
	WORD		wInch;
	DWORD		dwReserved;
	WORD		wCheckSum;
} APMHEADER, *PAPMHEADER;
#pragma pack( pop )

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CalculateAPMCheckSum
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	Aldus Placeable Metafile (APM) _xZkqqHx_iCmMiDhHiDgCiDfPiCmMiDgAiDeGiDgCiDeOiDfEiDiAiCpAiMhGiOfKiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	apmfh	:APM_xZkqqHx_iDhHiDgCiDfPiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iDgAiDeGiDgCiDeOiDfEiDiAiCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iPnKiNnH_xHqqkZx_>	CFCMolipDrawSrvrItem::SaveSelectedWMF _xZkqqHx_iCpAiOfBiPmGiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iJpAjAoA_xHqqkZx_>	_xZkqqHx_iImIiJlKiCmMiDfMiBfLiDfIiDfCiBfLiDgIiCmNiBeB_xHqqkZx_ENMETA_xZkqqHx_iCkJiCoHiOnIjHhAiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	01.08.31 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
static WORD CalculateAPMCheckSum (const APMHEADER& apmfh)
{
	LPWORD	lpWord;
	WORD	wResult, i;
	// Start with the first word
	wResult = *(lpWord = (LPWORD)(&apmfh));
	// XOR in each of the other 9 words
	for (i = 1; i <= 9; i++)
	{
		wResult ^= lpWord[i];
	}
	return wResult;
} // CalculateAPMCheckSum.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCMolipDrawSrvrItem::SaveSelectedWMF
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_jBeJjBpAjFjEjFgJiCmMiDiBiDfOiDhEiDeAiDeDiDiLiCpAiOhHjCoIiCmMiDhEiDeAiDeDiDiLiCmJjFnLjBlGiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	tcpPath	:_xZkqqHx_jFnLjBlGiClHiCoJiDhEiDeAiDeDiDiLjGlMiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iPnKiNnH_xHqqkZx_>	_xZkqqHx_jFnLjBlGiMgAiOkOiCmNiBeB_xHqqkZx_Aldus Placeable Metafile (APM) format _xZkqqHx_iCpAiOgHiCkEiBeC_xHqqkZx_
 *			Windows _xZkqqHx_iCmFjHkMjCmKiClFiCmEiCkCiCoJ_xHqqkZx_ WMF _xZkqqHx_iCmNiBeB_xHqqkZx_APM _xZkqqHx_iCoHiClFiCkCiBeC_xHqqkZx_
 *			PowerPoint_xZkqqHx_iCmFiPgPjHmNiClDiCoKiCoJiCmMiCmNiBeB_xHqqkZx_APM _xZkqqHx_iClOiCmBiClNiBeCiDhGiDiMiDhCiDiFiBfLiCmFiCoA_xHqqkZx_
 *			APM _xZkqqHx_iCmFiCmIiCkCiCmGjEeGiOkPiCmFiCkLiCmIiCkCiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iJpAjAoA_xHqqkZx_>	_xZkqqHx_iDgGiBfLiDfOiCpAiKgHjCkDiDiBiDfOiDhEiDeAiDeDiDiLiMgAiOkOiCmFiOoGiCoIiPgPiClFiCmEiCkJiCoHiBeB_xHqqkZx_WMF_xZkqqHx_iCmJjFmPiKlHiClHiCoJiBeC_xHqqkZx_
 *			_xZkqqHx_iImIiJlKiCmMiDfMiBfLiDfIiDfCiBfLiDgIiCmNiBeB_xHqqkZx_ENMETA_xZkqqHx_iCkJiCoHiOnIjHhAiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	01.05.23 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *			01.08.31 Fukushiro M. APM_xZkqqHx_iCmJjFmPiNfIiBeC_xHqqkZx_
 *************************************************************************/
BOOL CFCMolipDrawSrvrItem::SaveSelectedWMF (const wchar_t* tcpPath,
										mmetol mmMarginLeft, mmetol mmMarginTop,
										mmetol mmMarginRight, mmetol mmMarginBottom)
{
	// _xZkqqHx_iDfGiBfLiDgHiDhNiDgMiBfLiDfHiDiDiCpAiBeBjBeJjBpAjCiGiCmMjFjEjFgJiCmMiCnNiCmJjChFiCkLiKlHiCkGiCoJiBeC_xHqqkZx_
	FCSheetManager sheetManager;
	sheetManager.GetFrontSheet()->AppendToLZOrder(g_pView->SelectObjVector());
	FCSheetManager* pSMOrig = g_pDoc->SetSheetManager(&sheetManager);
	// _xZkqqHx_iKgHjCkDiDiBiDfOiDhEiDeAiDeDiDiLiCpAiOoGjDlOiBeC_xHqqkZx_
	HENHMETAFILE hEmf = GetCurrentSheetEMF(NULL, mmMarginLeft, mmMarginTop,
												mmMarginRight, mmMarginBottom);
	// _xZkqqHx_jBnCjEpAiClFiCmEiCkCiClNiDfGiBfLiDgHiDhNiDgMiBfLiDfHiDiDiCpAjFjMiLeBiBeC_xHqqkZx_
	(void)g_pDoc->SetSheetManager(pSMOrig);
	if (hEmf == NULL) return FALSE;

	//----- APM _xZkqqHx_iCmMiDhHiDgCiDfPiCpAiNoMjAkM_xHqqkZx_ -----
	ENHMETAHEADER emh;
	// Initialize the header
	ZeroMemory(&emh, sizeof(ENHMETAHEADER));
	emh.nSize = sizeof(ENHMETAHEADER);
	// Fill in the enhanced metafile header
	if(GetEnhMetaFileHeader(hEmf, sizeof(ENHMETAHEADER), &emh) == 0)
		return FALSE;

	// ENHMETAHEADER::rclFrame _xZkqqHx_iCmNiBeB_xHqqkZx_0.1mm_xZkqqHx_jCfAiImKiCmMiDhEiDiMiBfLiDiAiDfEiDeDiDfJiBeC_xHqqkZx_
	// 1 inch = 25.4mm_xZkqqHx_iBeC_xHqqkZx_
	// rclFrame.top _xZkqqHx_iCkK_xHqqkZx_ 1 inch _xZkqqHx_iCmMiPoKiNiHiBeB_xHqqkZx_rclFrame.top = 254_xZkqqHx_iBeC_xHqqkZx_
	// APMHEADER::bbox.Top = 1000 * 254 / 2540 = 100_xZkqqHx_iBeC_xHqqkZx_
	// _xZkqqHx_jBkGiClPiBeB_xHqqkZx_APMHEADER::bbox _xZkqqHx_iCmNiBeB_xHqqkZx_0.01 inch _xZkqqHx_jCfAiImKiCmMiDhEiDiMiBfLiDiAiDfEiDeDiDfJiBeC_xHqqkZx_
	// Fill in the Aldus Placeable Header.
	APMHEADER APMHeader;
	APMHeader.dwKey = 0x9ac6cdd7;
	APMHeader.hmf = 0;
	APMHeader.bbox.Top		= D2L(1000.0 * emh.rclFrame.top / 2540.0);
	APMHeader.bbox.Left		= D2L(1000.0 * emh.rclFrame.left / 2540.0);
	APMHeader.bbox.Right	= D2L(1000.0 * emh.rclFrame.right / 2540.0);
	APMHeader.bbox.Bottom	= D2L(1000.0 * emh.rclFrame.bottom / 2540.0);
	APMHeader.wInch = 1000;
	APMHeader.dwReserved = 0;
	APMHeader.wCheckSum = CalculateAPMCheckSum(APMHeader);

	//----- WMF _xZkqqHx_iCmMiDhCiDgCiDgHiDgGiBfLiDfOiCpAiNoMjAkM_xHqqkZx_ -----
	// Need a reference DC
	HDC hDC = GetDC(NULL);
	// How big will the metafile bits be?
	DWORD dwSize = ::GetWinMetaFileBits(hEmf, 0, NULL, MM_ANISOTROPIC, hDC);
	// Allocate that much memory
	BYTEVector byBits(dwSize);
	// Let windows convert the enhanced metafile to a 16 windows metafile
	::GetWinMetaFileBits(hEmf, dwSize, byBits.begin(), MM_ANISOTROPIC, hDC);
	// Release the reference DC
	::ReleaseDC(NULL, hDC);

	//----- WMF _xZkqqHx_iCmMiDhEiDeAiDeDiDiLiCpAiNoMjAkM_xHqqkZx_ -----
	// Open the file
	HANDLE hFile = ::CreateFile(WStrToTStr(tcpPath), GENERIC_WRITE, 0, NULL,
								CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
	if (hFile == INVALID_HANDLE_VALUE) return FALSE;
	// Write the Aldus Placeable Header
	DWORD dwBytes;
	::WriteFile(hFile, &APMHeader, sizeof(APMHEADER), &dwBytes, NULL);
	// Write the metafile bits
	BOOL bSuccess = ::WriteFile(hFile, byBits.begin(), dwSize, &dwBytes, NULL);
	::CloseHandle(hFile);
	::DeleteEnhMetaFile(hEmf);
	return bSuccess;
} // CFCMolipDrawSrvrItem::SaveSelectedWMF.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCMolipDrawSrvrItem::SaveSelectedEMF
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_jBeJjBpAjFjEjFgJiCmMiKgHjCkDiDiBiDfOiDhEiDeAiDeDiDiLiCpAiOhHjCoIiCmMiDhEiDeAiDeDiDiLiCmJjFnLjBlGiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	tcpPath	:_xZkqqHx_jFnLjBlGiClHiCoJiDhEiDeAiDeDiDiLjGlMiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	01.06.01 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
BOOL CFCMolipDrawSrvrItem::SaveSelectedEMF (const wchar_t* tcpPath,
										mmetol mmMarginLeft, mmetol mmMarginTop,
										mmetol mmMarginRight, mmetol mmMarginBottom)
{
	// _xZkqqHx_iDfGiBfLiDgHiDhNiDgMiBfLiDfHiDiDiCpAiBeBjBeJjBpAjCiGiCmMjFjEjFgJiCmMiCnNiCmJjChFiCkLiKlHiCkGiCoJiBeC_xHqqkZx_
	FCSheetManager sheetManager;
	sheetManager.GetFrontSheet()->AppendToLZOrder(g_pView->SelectObjVector());
	FCSheetManager* pSMOrig = g_pDoc->SetSheetManager(&sheetManager);
	// _xZkqqHx_iKgHjCkDiDiBiDfOiDhEiDeAiDeDiDiLiCpAiOoGjDlOiBeC_xHqqkZx_
	HENHMETAFILE hEmf = GetCurrentSheetEMF(tcpPath, mmMarginLeft, mmMarginTop,
												mmMarginRight, mmMarginBottom);
	// _xZkqqHx_jBnCjEpAiClFiCmEiCkCiClNiDfGiBfLiDgHiDhNiDgMiBfLiDfHiDiDiCpAjFjMiLeBiBeC_xHqqkZx_
	(void)g_pDoc->SetSheetManager(pSMOrig);
	if (hEmf == NULL) return FALSE;
	::DeleteEnhMetaFile(hEmf);
	return TRUE;
} // CFCMolipDrawSrvrItem::SaveSelectedEMF.

//----- 02.10.26 Fukushiro M. _xZkqqHx_jCmHiJmBiOgO_xHqqkZx_ (_xZkqqHx_iKgHjCkDiDiBiDfOiDhEiDeAiDeDiDiLiCmMiDhHiDgCiDfPiCpAiPjBjBnGiCkGiCmEiBeBjAlIjDhIiCpAiNiCiCnPiCoJ_xHqqkZx_)-----
/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	myEnumEnhMetafileProc
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	EnumEnhMetaFile_xZkqqHx_iKnGjAjEiCmMiDfCiBfLiDiLiDgPiDgCiDeOiKnGjAjEiBeC_xHqqkZx_
 *			_xZkqqHx_iKgHjCkDiDiBiDfOiDhEiDeAiDeDiDiLjCiGiCmMiDiMiDfCiBfLiDgIiCpAjHpBiLjDiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	hDC			:EnumEnhMetaFile_xZkqqHx_iCmFjAnNjCoIiClDiCoKiClN_xHqqkZx_HDC_xZkqqHx_iCpAiOhHjCoIiBeC_xHqqkZx_
 *			lpHTable	:_xZkqqHx_iDePiDiJiDhEiDeCiDgCiDeOiDfIiDeJiDhFiDfHiDeGiDeOiDgHiCmMiDgOiDjDiDgIiDiLiCnGiCmM_xHqqkZx_
 *						 _xZkqqHx_iDgFiBfLiDhFiDiLiCpAiOhHjCoIiBeC_xHqqkZx_
 *			lpEMFR		:_xZkqqHx_iDiBiDfOiDhEiDeAiDeDiDiLiCmMiDiMiDfCiBfLiDgIiCpAiOhHjCoIiBeC_xHqqkZx_
 *			nObj		:lpHTable_xZkqqHx_iCmMiDfEiDeDiDfJiCpAiOhHjCoIiBeC_xHqqkZx_
 *			lpData		:EnumEnhMetaFile_xZkqqHx_iCmFjAnNjCoIiClDiCoKiClNjCgMiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_jHpBiLjDiCpAjBlBiCkPiCoJiPoKiNiHiCmN_xHqqkZx_0_xZkqqHx_iImIiKePiCpAiBeBjHpBiLjDiCpAjCoCiOhOiClHiCoJiPoKiNiHiCmN_xHqqkZx_0_xZkqqHx_iCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iJpAjAoA_xHqqkZx_>	MSWORD2000_xZkqqHx_iCmJjDfMiCoIjFhEiCkPiCoJiPoKiNiHiCmMiBeB_xHqqkZx_ENHMETAHEADER_xZkqqHx_iCmMiDiBiDjDiDgPiCmJiCmCiCkCiCmEiBeC_xHqqkZx_
 *			rclBounds		_xZkqqHx_jAhNiCmMiKgHiPgLiBeBiDhEiDiMiBfLiDiAiDfEiDeDiDfJiCmJiKnGiMfHjGlDiClFiBeC_xHqqkZx_
 *							_xZkqqHx_iLlAiCoHiCkNiBeBiDgPiDeFiDjDiDfJiCmMiCnNiBeC_xHqqkZx_
 *							_xZkqqHx_iIpDiNpMiOjOiCmJiCmNiOgHiCoNiCoKiCoJiCnNiClNiCkCiBeCiClBiCmMjCgMiCpAiPkMiClDiCkNiClHiCoJiCmG_xHqqkZx_
 *							_xZkqqHx_iIpDiNpMiClDiCoKiCmIiCkCiBeC_xHqqkZx_
 *			rclFrame		_xZkqqHx_jDfMiCoIjFhEiCkPiClNjAhNiCmMiDhEiDiMiBfLiDiAiDfEiDeDiDfJiBeCjAhNiCmMjBoFiCkLiClDiCmN_xHqqkZx_
 *							_xZkqqHx_jFmPiCoHiCmIiCkCiCkKiBeBjAhNiCpAiImNiCnOiDhEiDiMiBfLiDiAiCmMjBoFiCkLiClDiCmNiClBiCmMjCgMiCmF_xHqqkZx_
 *							_xZkqqHx_iMiIjCoIiClDiCoKiCoJiBeCiClBiCmMjCgMiCkKiPkMiClDiCkCiCmGiBeBiDhEiDiMiBfLiDiAiCkKjAhNiCoGiCoI_xHqqkZx_
 *							_xZkqqHx_iPkMiClDiCkNiCmIiCmBiCmEiBeBjAhNiCmMiJeFiJlKiCkKjAnIiCoKiClNiDeDiDiBiBfLiDfHiCkK_xHqqkZx_
 *							_xZkqqHx_jDfMiCoIjFhEiCkPiCoHiCoKiCoJiBeC_xHqqkZx_
 *			szlDevice		szlDevice_xZkqqHx_iCmG_xHqqkZx_szlMillimeters_xZkqqHx_iCmMjEoEjHkGiCmFjDfMiCoIjFhEiCkPiClNjAhNiCmM_xHqqkZx_
 *							_xZkqqHx_iKgHiPgLiCkKiMiIjCoIiClDiCoKiCoJiBeC_xHqqkZx_rclFrame_xZkqqHx_iCmNiKgHiPgLiCmJjGlDiKnGiMfHiBeC_xHqqkZx_
 *			szlMillimeters	szlDevice_xZkqqHx_iCmG_xHqqkZx_szlMillimeters_xZkqqHx_iCmMjEoEjHkGiCmFjDfMiCoIjFhEiCkPiClNjAhNiCmM_xHqqkZx_
 *							_xZkqqHx_iKgHiPgLiCkKiMiIjCoIiClDiCoKiCoJiBeC_xHqqkZx_rclFrame_xZkqqHx_iCmNiKgHiPgLiCmJjGlDiKnGiMfHiBeC_xHqqkZx_
 *
 *			MSWORD2000_xZkqqHx_iCmJiKgHjCkDiDiBiDfOiDhEiDeAiDeDiDiLiCpAjDfMiCoIjFhEiCkPiCoJiPoKiNiHiBeBjFhDiOhGiLgDiCmIiMlLiPnLiCkK_xHqqkZx_
 *			_xZkqqHx_jEkNjAlGiClHiCoJiBeC_xHqqkZx_
 *			FD_COPY_RESOLUTION == 1 _xZkqqHx_iCmMiPoKiNiHiBeBjDfMiCoIjFhEiCkPiClNjAhNiCmM_xHqqkZx_
 *			_xZkqqHx_iDfEiDeDiDfJiCkKiBeB_xHqqkZx_DD3_xZkqqHx_iPoDiCmMjAhNiCmMiDfEiDeDiDfJiCmGiIoBiCmBiCmEiClFiCnMiCkEiBeCiCmGiClBiCoLiCkKiBeB_xHqqkZx_
 *			2 <= FD_COPY_RESOLUTION _xZkqqHx_iCmMiPoKiNiHiCmNiBeB_xHqqkZx_DD3_xZkqqHx_iPoDiCmMjAhNiCmMiDfEiDeDiDfJiCmG_xHqqkZx_
 *			_xZkqqHx_iIoKjChGiClHiCoJiBeC_xHqqkZx_
 *			WORD2000_xZkqqHx_iCmMiJoGjGmKjFfMiOkGiCpAjClCiCnHiCmEiCnNiCoJiCmGiBeB_xHqqkZx_100%_xZkqqHx_jFfMiOkGiCmMiPoKiNiHiBeBiJoGjGmKiPoDiCmFiCmM_xHqqkZx_
 *			_xZkqqHx_iLjHjHkDiCmGjFfMiOkGiCmMjEoEjHkGiCmN_xHqqkZx_DD3_xZkqqHx_iCmM_xHqqkZx_100%_xZkqqHx_jFfMiOkGiCmGiIoKjChGiClHiCoJiBeC_xHqqkZx_
 *			_xZkqqHx_jBkGiClPiBeB_xHqqkZx_WORD2000_xZkqqHx_iCoAiBeB_xHqqkZx_g_->dDisplayPPM_xZkqqHx_iCmGjDkPiClGjCgMiCpAiKoOiPiAiCmJiJoGjGmKiDfEiDeDiDfJiCpA_xHqqkZx_
 *			_xZkqqHx_iMiIjCoIiClFiCmEiCkCiCoJiBeC_xHqqkZx_g_->dDisplayPPM_xZkqqHx_iCmNiBeB_xHqqkZx_Windows_xZkqqHx_iCmFjFfHiPiAjDeJiCmJiOgHiCoNiCoKiCoJ_xHqqkZx_
 *			_xZkqqHx_iDhEiDeIiDjDiDgHiCmMiDhMiDeDiDjDiDgHiMhGiOfKjFpLjGeAiCmMjCgMiCmIiCmMiCmFiBeBjDlJjHjNiCmJiCkJiCmIiCmBiCmEiCkCiCoJiBeC_xHqqkZx_
 *			_xZkqqHx_iCmGiClBiCoLiCkKiBeB_xHqqkZx_WORD2000_xZkqqHx_iCmNiKgHjCkDiDiBiDfOiDhEiDeAiDeDiDiLiCpAjDfMiCoIjFhEiCkPiCoJiPoKiNiHiBeB_xHqqkZx_
 *			_xZkqqHx_iDhHiDgCiDfPjCiGiCmM_xHqqkZx_HORZRES,HORZSIZE,VERTRES,VERTSIZE_xZkqqHx_iCmGiBeBiDgGiDeCiDfIiDhGiDiMiDeDiCmM_xHqqkZx_
 *			HORZRES,HORZSIZE,VERTRES,VERTSIZE_xZkqqHx_iCpAjEoEiKhCiClFiCmEiLhEjFoCjAlDiCpAiClFiCmE_xHqqkZx_
 *			_xZkqqHx_jDfMiCoIjFhEiCkPiCmEiCkCiCoJiBeCiClBiCoKiCoAjDlJjHjNiCmJiKjAiCmBiCmEiCkCiCoJiBeCiCmGiMlOiCkEiCmMiCmNiBeB_xHqqkZx_
 *			_xZkqqHx_iKgHjCkDiDiBiDfOiDhEiDeAiDeDiDiLiCmMiDhHiDgCiDfPiCmJiCmN_xHqqkZx_LOGPIXELSX _xZkqqHx_iCmMjCgMiCmNiLeMjIfOiClDiCoKiCmEiCkIiCoHiClIiBeB_xHqqkZx_
 *			HORZRES,HORZSIZE,VERTRES,VERTSIZE _xZkqqHx_iCkKiLeMjIfOiClDiCoKiCmEiCkCiCoJiClNiCnPiBeB_xHqqkZx_
 *			_xZkqqHx_iClBiCmMjCgMiCmFiCmMiCnNiDfEiDeDiDfJiCmMiIoBiCkCiCpAjFoCjAlDiJmCjEfMiClOiCkJiCoHiCmFiCkAiCoJiBeC_xHqqkZx_
 *			_xZkqqHx_iDhNiDfJiDeDiCmMiCmNiBeB_xHqqkZx_NT_xZkqqHx_iMgOiCmMiPoKiNiHiBeB_xHqqkZx_LOGPIXELSX_xZkqqHx_iCmGiBeB_xHqqkZx_HORZRES,HORZSIZE_xZkqqHx_iCmMjCgMiCmJ_xHqqkZx_
 *			_xZkqqHx_iIoBiCkCiCkKiCkAiCoJiClBiCmGiCmFiCkAiCoJiBeCiClBiCmMiClNiCnPiBeB_xHqqkZx_WORD2000_xZkqqHx_iCmJ_xHqqkZx_DD3_xZkqqHx_iCmMjAhNiCpA_xHqqkZx_
 *			_xZkqqHx_jDfMiCoIjFhEiCkPiClNiPoKiNiHiCmJiBeBiDfEiDeDiDfJiCkKiIoBiCkEiCmGiCkCiCkEiMlLiPnLiCkKjEkNjAlGiClFiCmEiClFiCnMiCkEiBeC_xHqqkZx_
 *			_xZkqqHx_jFhDiOhGiLgDiCmIiCmMiCmNiBeB_xHqqkZx_WORD2000_xZkqqHx_iCmNiBeBiDhHiDgCiDfPjCiGiCmM_xHqqkZx_HORZRES/HORZSIZE
 *			(VERTRES/VERTSIZE)_xZkqqHx_iCkKiDgGiDeCiDfIiDhGiDiMiDeDiCmMiClLiCoKiCmG_xHqqkZx_"_xZkqqHx_jBoFiCkLiCkN_xHqqkZx_"_xZkqqHx_iInJiCmIiCoJiPoKiNiHiBeB_xHqqkZx_
 *			_xZkqqHx_iDgGiDeCiDfIiDhGiDiMiDeDiCmM_xHqqkZx_LOGPIXELSX _xZkqqHx_iCmGjEoEiKhCiClFiCmEiLhEjFoCjAlDiCpAiCkJiCkPiCmEiCkCiCoJiClBiCmGiCmFiCkAiCoJiBeC_xHqqkZx_
 *			_xZkqqHx_iClBiCmMiClNiCnPiBeB_xHqqkZx_"_xZkqqHx_jBoFiCkLiCkN_xHqqkZx_"_xZkqqHx_iInJiCmIiCoJiPoKiNiH_xHqqkZx_ _xZkqqHx_jBkGiClP_xHqqkZx_ 2 <= FD_COPY_RESOLUTION
 *			_xZkqqHx_iCmGiBeB_xHqqkZx_1 = FD_COPY_RESOLUTION _xZkqqHx_iCmMiPoKiNiHiCmMiPiIjHjNiCpAiIoBiCkGiCoJ_xHqqkZx_
 *			_xZkqqHx_jFeLjHhGiCkKiCkAiCoJiBeC_xHqqkZx_
 *
 *			_xZkqqHx_iCmGiOhGiCmBiClNiCkKiBeBiKgHjCkDiDiBiDfOiDhEiDeAiDeDiDiLiCpAiDiBiDfOiDfCiDjDiCmFjFnLjBlGiClHiCoJiPoKiNiHiCmIiCmHiBeB_xHqqkZx_
 *			_xZkqqHx_iClBiCmMiCoGiCkEiCmIoIiHjCgMiCmNjBlGiNnNiClFiCmIiCkCiCmMiCmFiBeBjFmPiCmJiCmIiCoJiBeC_xHqqkZx_
 *			_xZkqqHx_iDfCiDhDiBfLiOjOiCmMoIiHjCgMiCpAiOoGiCoIjFkFiCmBiCmEiClFiCnMiCkEiCmGiBeBjDkPiClGjAhNiCpA_xHqqkZx_DD3_xZkqqHx_iPoDiCmFiDfCiDhDiBfLiBjF_xHqqkZx_
 *			EMF_xZkqqHx_iDhJiBfLiDfIiDgHiCmFjDkPiClGjBoFiCkLiClDiCmMjDfMiCoIjFhEiCkPiCkKiPgPjHiIiCmIiCkNiCmIiCoJiBeC_xHqqkZx_
 *			_xZkqqHx_iCnMiClNiBeB_xHqqkZx_WORD_xZkqqHx_iImIiKePiCmMiDeBiDhGiDiKiCmMjAhNiCpAjDfMiCoIjFhEiCkPiClNiPoKiNiHiCoAiBeBjBoFiCkLiClDiCkKiInJiPoNiCmJiCmIiCoJiBeC_xHqqkZx_
 *			_xZkqqHx_iCoGiCmBiCmEiBeBjDfMiCoIjFhEiCkPiOjOiCmMoIiHjCgMiCoAiOoGiCoIjFkFiCkEiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	02.10.26 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
int CALLBACK myEnumEnhMetafileProc (HDC hDC, HANDLETABLE *lpHTable,
								ENHMETARECORD *lpEMFR, int nObj, LPARAM lpData)
{
	if (lpEMFR->iType - EMR_MIN == 0)
	//----- _xZkqqHx_iKgHjCkDiDiBiDfOiDhEiDeAiDeDiDiLiDhHiDgCiDfPiDiMiDfCiBfLiDgIiCmMiPoKiNiH_xHqqkZx_ -----
	{
		ENHMETAHEADER* pEmh = (ENHMETAHEADER*)lpEMFR;
		// _xZkqqHx_iJoGjGmKiDhDiDeOiDfKiDiLjAjEiCpA_xHqqkZx_ 10000 _xZkqqHx_iCmGiClFiClNiPoKiNiHiCmMiBeBiJoGjGmKiDfEiDeDiDfJiBeC_xHqqkZx_
		const mmetol mmDisplaySize = 10000 / g_->dDisplayPPM;
		// _xZkqqHx_iJoGjGmKiDhDiDeOiDfKiDiLjAjEiCpAiLeMjIfOiBeC_xHqqkZx_
		pEmh->szlDevice.cx = 10000;
		pEmh->szlDevice.cy = 10000;
		// _xZkqqHx_iJoGjGmKiDfEiDeDiDfJiCpAiLeMjIfOiBeCiJpAjBjMjDhIiCmFjFoCjAlDiBeC_xHqqkZx_
//----- 05.08.19 Fukushiro M. _xZkqqHx_jFmPiNfIjBeP_xHqqkZx_ ()-----
//		pEmh->szlMillimeters.cx = mmDisplaySize / g_pReg->GetCopyResolution();
//		pEmh->szlMillimeters.cy = mmDisplaySize / g_pReg->GetCopyResolution();
//----- 05.08.19 Fukushiro M. _xZkqqHx_jFmPiNfIiMoD_xHqqkZx_ ()-----
		pEmh->szlMillimeters.cx = mmDisplaySize / double(FD_COPY_RESOLUTION);
		pEmh->szlMillimeters.cy = mmDisplaySize / double(FD_COPY_RESOLUTION);
//----- 05.08.19 Fukushiro M. _xZkqqHx_jFmPiNfIiPeJ_xHqqkZx_ ()-----
		// _xZkqqHx_jHpBiLjDiPiIjHjNiCpAiPeJjHlJiBeC_xHqqkZx_
		return 0;
	}
	return 1;
} // myEnumEnhMetafileProc.
//----- 02.10.26 Fukushiro M. _xZkqqHx_jCmHiJmBiPeJ_xHqqkZx_ (_xZkqqHx_iKgHjCkDiDiBiDfOiDhEiDeAiDeDiDiLiCmMiDhHiDgCiDfPiCpAiPjBjBnGiCkGiCmEiBeBjAlIjDhIiCpAiNiCiCnPiCoJ_xHqqkZx_)-----

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCMolipDrawSrvrItem::GetCurrentSheetEMF
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDeKiDiMiDjDiDgHiDfGiBfLiDgHiCmMjFjEjFgJiCmMiKgHjCkDiDiBiDfOiDhEiDeAiDeDiDiLiCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	tcpPath	:_xZkqqHx_jFnLjBlGiClHiCoJiDhEiDeAiDeDiDiLjGlMiCpAiOhHjCoIiBeCiDhEiDeAiDeDiDiLjFnLjBlGiClFiCmIiCkCiPoKiNiHiCmN_xHqqkZx_ NULL_xZkqqHx_iBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	01.05.18 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
HENHMETAFILE CFCMolipDrawSrvrItem::GetCurrentSheetEMF (const wchar_t* tcpPath,
											mmetol mmMarginLeft, mmetol mmMarginTop,
											mmetol mmMarginRight, mmetol mmMarginBottom)
{
	CMetaFileDC dc;
	HDC hAttribDC = NULL;
// 02.11.01 Fukushiro M. 1_xZkqqHx_iNhDjCmHiJmB_xHqqkZx_ (_xZkqqHx_iKgHjCkDiDiBiDfOiDhEiDeAiDeDiDiLiCmMiDhHiDgCiDfPiCpAiPjBjBnGiCkGiCmEiBeBjAlIjDhIiCpAiNiCiCnPiCoJ_xHqqkZx_)
	HENHMETAFILE hEMF = NULL;
do {
	// _xZkqqHx_jBfDiCmEiCmMiChJiDeJiBfLiDfPiBfLiCpAiOoGjDlOiBeC_xHqqkZx_
	FCZOrder zOrder;
	g_pDoc->GetZOrder(zOrder, FDOZ_ON_ANY);
	if (zOrder.IsEmpty()) break;
	ObjDynabaseVector vObj;
	DBLRect mmrtFrame;
	// _xZkqqHx_iDiBiDfOiDhEiDeAiDeDiDiLiCmM_xHqqkZx_OnDraw _xZkqqHx_iCmJiNiHiCoNiClJiCmEjFjEjFgJiNmFjBoFiNmAjFfHjCgMiCpAiLhEiOfKiClHiCoJiBeC_xHqqkZx_
	CSize rSizeMax(32700, 32700);
	// _xZkqqHx_iDhJiBfLiDfIiDgHiJmCjEfMiCmIjFjEjFgJiCmGiBeBiKePjAnKiDhEiDiMiBfLiDiAiCpAiMhGiOfKiBeC_xHqqkZx_
	if (!GetPasteObjFrame(vObj, mmrtFrame, &zOrder, rSizeMax.cx, rSizeMax.cy))
		AfxGetMainWnd()->PostMessage(WM_USER_COPY_WARNING);
	if (vObj.empty()) break;

//----- 01.07.21 Fukushiro M. _xZkqqHx_jCmHiJmBiOgO_xHqqkZx_ ()-----
	//----- _xZkqqHx_iDhNiBfLiDfHiDjDjFkKiKgHjCkDiClHiCoJ_xHqqkZx_ -----
	mmrtFrame.left	-= mmMarginLeft;
	mmrtFrame.top	-= mmMarginTop;
	mmrtFrame.right	+= mmMarginRight;
	mmrtFrame.bottom += mmMarginBottom;
//----- 01.07.21 Fukushiro M. _xZkqqHx_jCmHiJmBiPeJ_xHqqkZx_ ()-----
//----- 05.07.31 Fukushiro M. _xZkqqHx_jCmHiJmBiOgO_xHqqkZx_ ()-----
	// _xZkqqHx_iDhEiDiMiBfLiDiAiLoJiMgAiCpAiDgNiBfLiDhNiDiLiCmJiBeC_xHqqkZx_mmMarginXXX _xZkqqHx_iCmJjFiJiCmMjCgMiCpAjAnNjCoIiCmFiCkLiCoJiCoGiCkEiCmJiClFiClNiClNiCnPiBeC_xHqqkZx_
	mmrtFrame.NormalizeRect();
//----- 05.07.31 Fukushiro M. _xZkqqHx_jCmHiJmBiPeJ_xHqqkZx_ ()-----

//----- 02.10.27 Fukushiro M. _xZkqqHx_jFmPiNfIjBeP_xHqqkZx_ (_xZkqqHx_iKgHjCkDiDiBiDfOiDhEiDeAiDeDiDiLiCmMiDhHiDgCiDfPiCpAiPjBjBnGiCkGiCmEiBeBjAlIjDhIiCpAiNiCiCnPiCoJ_xHqqkZx_)-----
//	// -------------------------------------------------------------
//	// _xZkqqHx_iKgHjCkDiDiBiDfOiDhEiDeAiDeDiDiL_xHqqkZx_(EMF)_xZkqqHx_iCmMjCfAiImKiCmJiCmCiCkCiCmE_xHqqkZx_
//	// EMF_xZkqqHx_iCmMiDhHiDgCiDfPjCiGiCmJiCmNiBeB_xHqqkZx_EMF_xZkqqHx_iCpAiNmEjAlGiClHiCoJiCmGiCkLiCmMiClNiCnPiCmJiBeBiDgGiDeCiDfIiDhGiDiMiDeDiCmM_xHqqkZx_
//	// _xZkqqHx_jFjN_xHqqkZx_/_xZkqqHx_iNiCiClDiCpA_xHqqkZx_pixel_xZkqqHx_iCmG_xHqqkZx_mm_xZkqqHx_iCmFiLeMjIfOiClFiCmEiCkCiCoJiBeC_xHqqkZx_
//	// _xZkqqHx_iCmCiCnMiCoIiBeBiClBiCmMjCgMiCkJiCoH_xHqqkZx_ dpm_xZkqqHx_iCpAiOfKiPgPiClFiCmEiBeBiNmEjAlGjAoGiCmMiDgGiDeCiDfIiDhGiDiMiDeDiCmM_xHqqkZx_
//	// dpm_xZkqqHx_iCmGjEoEiKhCiClFiCmEiBeBiKgHiPgLiClHiCoJiBeC_xHqqkZx_
//	// _xZkqqHx_iCmGiClBiCoLiCkKiBeB_xHqqkZx_Molip Draw _xZkqqHx_iCmFiCmNiBeB_xHqqkZx_dpm _xZkqqHx_iCpA_xHqqkZx_GetDeviceCaps(LOGPIXELSX)_xZkqqHx_iCpA_xHqqkZx_
//	// _xZkqqHx_iMlDiCmJiMhGiOfKiClFiCmEiCkCiCoJiCmMiCmFiBeBiPoDiLeMiCmMiDgGiDeCiDfIiDhGiDiMiDeDiDfEiDeDiDfJiCkJiCoHiCmMiOfKiPgPjFpLjGeA_xHqqkZx_
//	// _xZkqqHx_iCmGiCmNjCgMiCkKiClIiCoKiCmEiClFiCnMiCkEiBeC_xHqqkZx_
//	// _xZkqqHx_iClLiCmMiClNiCnPiBeBiImIiJlKiCmMiPiIjHjNiCmFiJoGjBjMiDfEiDeDiDfJiCpAiDgGiDeCiDfIiDhGiDiMiDeDiDfEiDeDiDfJiCpAiMlDiCmJ_xHqqkZx_
//	// _xZkqqHx_iClFiClNjCgMiCmJjFmPiKlHiClHiCoJiBeC_xHqqkZx_
//	// -------------------------------------------------------------
//	// Display_xZkqqHx_iCmMjIfPjHjN_xHqqkZx_mm_xZkqqHx_iCkAiClNiCoIiCmM_xHqqkZx_pixel_xZkqqHx_jAjEiCpAiMlDiCmJiMhGiOfKiClHiCoJiBeC_xHqqkZx_
//	mmetol mmRealW = mmrtFrame.Width();
//	mmetol mmRealH = mmrtFrame.Height();
//	mmown2real(mmRealW, mmRealH);
//	// HIMETRIC_xZkqqHx_iCmFiDhEiDiMiBfLiDiAiDfEiDeDiDfJiMhGiOfKiBeC_xHqqkZx_
//	CRect rtFrame100(0, 0, D2L(100 * mmRealW), D2L(100 * mmRealH));
//----- 02.10.27 Fukushiro M. _xZkqqHx_jFmPiNfIiMoD_xHqqkZx_ (_xZkqqHx_iKgHjCkDiDiBiDfOiDhEiDeAiDeDiDiLiCmMiDhHiDgCiDfPiCpAiPjBjBnGiCkGiCmEiBeBjAlIjDhIiCpAiNiCiCnPiCoJ_xHqqkZx_)-----
	// HIMETRIC_xZkqqHx_iCmFiDhEiDiMiBfLiDiAiDfEiDeDiDfJiMhGiOfKiBeC_xHqqkZx_
	const CRect rtFrame100(0, 0, D2L(100 * mmrtFrame.Width()),
								D2L(100 * mmrtFrame.Height()));
//----- 02.10.27 Fukushiro M. _xZkqqHx_jFmPiNfIiPeJ_xHqqkZx_ (_xZkqqHx_iKgHjCkDiDiBiDfOiDhEiDeAiDeDiDiLiCmMiDhHiDgCiDfPiCpAiPjBjBnGiCkGiCmEiBeBjAlIjDhIiCpAiNiCiCnPiCoJ_xHqqkZx_)-----

	// rtFrame100_xZkqqHx_iCpAiOhHjCoIiClFiCmIiCkNiCmEiCoAiOkJjDkOiCmFiMhGiOfKiClHiCoJiCkKiBeBiClBiClBiCmFjAnNjCoIiClFiClNjFpLiCkK_xHqqkZx_
	// _xZkqqHx_jAlDiKgNiCmIjCgMiCpAjAnNjCoIiCmFiCkLiCoJiBeC_xHqqkZx_
	// create attribute DC according to lpFormatEtc->ptd
	hAttribDC = ::CreateDC(_T("DISPLAY"), NULL, NULL, NULL);
	if (hAttribDC == NULL) break;
//----- 02.11.01 Fukushiro M. _xZkqqHx_jFmPiNfIjBeP_xHqqkZx_ (_xZkqqHx_iKgHjCkDiDiBiDfOiDhEiDeAiDeDiDiLiCmMiDhHiDgCiDfPiCpAiPjBjBnGiCkGiCmEiBeBjAlIjDhIiCpAiNiCiCnPiCoJ_xHqqkZx_)-----
//	if (!dc.CreateEnhanced(NULL, WStrToTStr(tcpPath), rtFrame100,
//						_T("Dynamic Draw\0Image\0\0"))) break;
//----- 02.11.01 Fukushiro M. _xZkqqHx_jFmPiNfIiMoD_xHqqkZx_ (_xZkqqHx_iKgHjCkDiDiBiDfOiDhEiDeAiDeDiDiLiCmMiDhHiDgCiDfPiCpAiPjBjBnGiCkGiCmEiBeBjAlIjDhIiCpAiNiCiCnPiCoJ_xHqqkZx_)-----
	// _xZkqqHx_iDhEiDeAiDeDiDiLiOhHjCoIiCmMiPoKiNiHiCmFiCoAiBeBiDiBiDiCiDiKiPoDiCmJ_xHqqkZx_EMF_xZkqqHx_iCpAiNoMjAkMiBeCiDhEiDeAiDeDiDiLiPoDiCmJiNoMjAkMiClHiCoJiCmGiBeB_xHqqkZx_
	// EnumEnhMetaFile _xZkqqHx_iCmFiCmMiPjBjBnGiCkGiCkKiCmFiCkLiCmIiCkNiCmIiCoJiClNiCnPiBeC_xHqqkZx_
	if (!dc.CreateEnhanced(NULL, NULL, rtFrame100, _T("Dynamic Draw\0Image\0\0"))) break;
//----- 02.11.01 Fukushiro M. _xZkqqHx_jFmPiNfIiPeJ_xHqqkZx_ (_xZkqqHx_iKgHjCkDiDiBiDfOiDhEiDeAiDeDiDiLiCmMiDhHiDgCiDfPiCpAiPjBjBnGiCkGiCmEiBeBjAlIjDhIiCpAiNiCiCnPiCoJ_xHqqkZx_)-----
	dc.SetAttribDC(hAttribDC);
	// _xZkqqHx_iDfIiDfOiDgCiDeOiCmJiPpDjBnEiPoOjFpBiCpAjBnCjEpAiBeC_xHqqkZx_
	dc.SaveDC();
	// Paint directly into the metafile.
	BOOL bResult = OnDrawEMF(&dc, vObj, mmrtFrame);
	// _xZkqqHx_jBnCjEpAiClFiClNiPoOjFpBiCpAjFjMiLeBiBeC_xHqqkZx_
	dc.RestoreDC(-1);
	if (!bResult) break;
	// attribute DC is no longer necessary
	dc.SetAttribDC(NULL);
	::DeleteDC(hAttribDC);
	hAttribDC = NULL;
//----- 02.10.27 Fukushiro M. _xZkqqHx_jFmPiNfIjBeP_xHqqkZx_ (_xZkqqHx_iKgHjCkDiDiBiDfOiDhEiDeAiDeDiDiLiCmMiDhHiDgCiDfPiCpAiPjBjBnGiCkGiCmEiBeBjAlIjDhIiCpAiNiCiCnPiCoJ_xHqqkZx_)-----
//	return dc.CloseEnhanced();
//----- 02.10.27 Fukushiro M. _xZkqqHx_jFmPiNfIiMoD_xHqqkZx_ (_xZkqqHx_iKgHjCkDiDiBiDfOiDhEiDeAiDeDiDiLiCmMiDhHiDgCiDfPiCpAiPjBjBnGiCkGiCmEiBeBjAlIjDhIiCpAiNiCiCnPiCoJ_xHqqkZx_)-----
	hEMF = dc.CloseEnhanced();
	// _xZkqqHx_iJpAjBjMjDhIiCkKoIiHjCgMiImIiPoDiCmMiPoKiNiHiCmNiBeBiKgHjCkDiDiBiDfOiDhEiDeAiDeDiDiLiCmMiDhHiDgCiDfPiCmM_xHqqkZx_
	// _xZkqqHx_iDfEiDeDiDfJiPoOjFpBiCpAiPeDjAlDiClHiCoJiBeC_xHqqkZx_
	// myEnumEnhMetafileProc _xZkqqHx_iCmMiJpAjAoAiCpAiOfBiPmGiBeC_xHqqkZx_
	RECT Rect;
	EnumEnhMetaFile(NULL, hEMF, (ENHMFENUMPROC)myEnumEnhMetafileProc,
					(LPVOID)NULL, &Rect);
//----- 02.11.01 Fukushiro M. _xZkqqHx_jCmHiJmBiOgO_xHqqkZx_ (_xZkqqHx_iKgHjCkDiDiBiDfOiDhEiDeAiDeDiDiLiCmMiDhHiDgCiDfPiCpAiPjBjBnGiCkGiCmEiBeBjAlIjDhIiCpAiNiCiCnPiCoJ_xHqqkZx_)-----
	// _xZkqqHx_iDhEiDeAiDeDiDiLiCnGiKgHjCkDiDiBiDfOiDhEiDeAiDeDiDiLiCpAjFnLjBlGiBeC_xHqqkZx_
	if (tcpPath != NULL && *tcpPath != _T('\0'))
	//----- _xZkqqHx_iKgHjCkDiDiBiDfOiDhEiDeAiDeDiDiLiCmMiDhEiDeAiDeDiDiLjGlMiCkKiOhHjCoIiClDiCoKiCmEiCkCiCoJiPoKiNiH_xHqqkZx_ -----
	{
		//----- EMF _xZkqqHx_iCmMiDhEiDeAiDeDiDiLiCpAiNoMjAkM_xHqqkZx_ -----
		// Open the file
		HANDLE hFile = ::CreateFile(WStrToTStr(tcpPath), GENERIC_WRITE, 0, NULL,
									CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
		if (hFile == INVALID_HANDLE_VALUE) break;
		// _xZkqqHx_iDiBiDfOiDhEiDeAiDeDiDiLiDgOiDjDiDgIiDiLiCkJiCoHiDiBiDfOiDhEiDeAiDeDiDiLiDgGiBfLiDfOiCpAiOoGjDlOiBeC_xHqqkZx_
		UINT dwSize = ::GetEnhMetaFileBits(hEMF, 0, NULL);
		BYTEVector vbyBuff;
		vbyBuff.assign(dwSize);
		GetEnhMetaFileBits(hEMF, dwSize, &vbyBuff[0]);
		DWORD dwBytes;
		// EMF_xZkqqHx_iCmMiDgGiBfLiDfOiCpAiPjBiCkLiPgPiClHiBeC_xHqqkZx_
		BOOL bSuccess = ::WriteFile(hFile, vbyBuff.begin(), dwSize, &dwBytes, NULL);
		::CloseHandle(hFile);
		if (!bSuccess) break;
	}
//----- 02.11.01 Fukushiro M. _xZkqqHx_jCmHiJmBiPeJ_xHqqkZx_ (_xZkqqHx_iKgHjCkDiDiBiDfOiDhEiDeAiDeDiDiLiCmMiDhHiDgCiDfPiCpAiPjBjBnGiCkGiCmEiBeBjAlIjDhIiCpAiNiCiCnPiCoJ_xHqqkZx_)-----
	return hEMF;
//----- 02.10.27 Fukushiro M. _xZkqqHx_jFmPiNfIiPeJ_xHqqkZx_ (_xZkqqHx_iKgHjCkDiDiBiDfOiDhEiDeAiDeDiDiLiCmMiDhHiDgCiDfPiCpAiPjBjBnGiCkGiCmEiBeBjAlIjDhIiCpAiNiCiCnPiCoJ_xHqqkZx_)-----
} while (FALSE);
	// attribute DC is no longer necessary
	dc.SetAttribDC(NULL);
	if (hAttribDC != NULL) ::DeleteDC(hAttribDC);
// 02.11.01 Fukushiro M. 1_xZkqqHx_iNhDjCmHiJmB_xHqqkZx_ (_xZkqqHx_iKgHjCkDiDiBiDfOiDhEiDeAiDeDiDiLiCmMiDhHiDgCiDfPiCpAiPjBjBnGiCkGiCmEiBeBjAlIjDhIiCpAiNiCiCnPiCoJ_xHqqkZx_)
	if (hEMF != NULL) ::DeleteEnhMetaFile(hEMF);
	return NULL;
} // CFCMolipDrawSrvrItem::GetCurrentSheetEMF.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCMolipDrawSrvrItem::GetEnhancedMetafileData
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	EMF_xZkqqHx_iDgGiBfLiDfOiCmMiOoGjDlOiOjOiCmJ_xHqqkZx_OnRenderData_xZkqqHx_iCmMiDeJiBfLiDgPiBfLiDiJiDeDiDgIiCkJiCoHiOmAiNhDiClDiCoKiCoJiBeC_xHqqkZx_
 *			COleServerItem::GetMetafileData_xZkqqHx_iKnGjAjEiCpAiOfBiPmGiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	lpFormatEtc	:_xZkqqHx_iPoOjFpBiCkKjHhGiLiBiClDiCoKiClNiMgAiOkOiCpAiOhHjCoIiClHiCoJ_xHqqkZx_FORMATETC_xZkqqHx_iNfMjBkCjBmMiCmM_xHqqkZx_
 *						 _xZkqqHx_iDhMiDeDiDjDiDfOiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_jAlDiPoNiPeJjHlJiClFiClNiPoKiNiHiCmN_xHqqkZx_ 0 _xZkqqHx_iImIiKePiCpAjFnEiClFiCnMiClHiBeCiClLiCoKiImIiKePiCmMiPoKiNiHiCmN_xHqqkZx_ 0 _xZkqqHx_iCpAjFnEiClFiCnMiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	00.03.31 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *			00.08.24 Fukushiro M. _xZkqqHx_iCkJiCmIiCoIiPeDjAkO_xHqqkZx_
 *************************************************************************/
BOOL CFCMolipDrawSrvrItem::GetEnhancedMetafileData (LPFORMATETC lpFormatEtc, LPSTGMEDIUM lpStgMedium)
{
	ASSERT_VALID(this);
	ASSERT(AfxIsValidAddress(lpFormatEtc, sizeof(FORMATETC), FALSE));
	ASSERT(AfxIsValidAddress(lpStgMedium, sizeof(STGMEDIUM)));
	ASSERT(lpStgMedium->tymed == TYMED_NULL);   // GetDataHere not valid
	ASSERT(lpStgMedium->pUnkForRelease == NULL);

//----- 02.10.21 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ (_xZkqqHx_jFhDjHhGiCmMiClNiCnP_xHqqkZx_)-----
//	CMetaFileDC dc;
//	HDC hAttribDC = NULL;
//----- 02.10.21 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ (_xZkqqHx_jFhDjHhGiCmMiClNiCnP_xHqqkZx_)-----
do {
	// medium must be TYMED_ENHMF -- cannot fill in existing HGLOBAL
	if (!(lpFormatEtc->tymed & TYMED_ENHMF) || lpStgMedium->hGlobal != NULL) break;

//----- 01.05.18 Fukushiro M. _xZkqqHx_jFmPiNfIjBeP_xHqqkZx_ ()-----
//	// _xZkqqHx_jBfDiCmEiCmMiChJiDeJiBfLiDfPiBfLiCpAiOoGjDlOiBeC_xHqqkZx_
//	FCZOrder zOrder;
//	g_pDoc->GetZOrder(zOrder, FDOZ_ON_ANY);
//	if (zOrder.IsEmpty()) break;
//	ObjDynabaseVector vObj;
//	DBLRect mmrtFrame;
//	// _xZkqqHx_iDiBiDfOiDhEiDeAiDeDiDiLiCmM_xHqqkZx_OnDraw _xZkqqHx_iCmJiNiHiCoNiClJiCmEjFjEjFgJiNmFjBoFiNmAjFfHjCgMiCpAiLhEiOfKiClHiCoJiBeC_xHqqkZx_
//	CSize rSizeMax(32700, 32700);
//	// _xZkqqHx_iDhJiBfLiDfIiDgHiJmCjEfMiCmIjFjEjFgJiCmGiBeBiKePjAnKiDhEiDiMiBfLiDiAiCpAiMhGiOfKiBeC_xHqqkZx_
//	if (!GetPasteObjFrame(vObj, mmrtFrame, &zOrder, rSizeMax.cx, rSizeMax.cy))
//		AfxGetMainWnd()->PostMessage(WM_USER_COPY_WARNING);
//	if (vObj.empty()) break;
//
//	// -------------------------------------------------------------
//	// _xZkqqHx_iKgHjCkDiDiBiDfOiDhEiDeAiDeDiDiL_xHqqkZx_(EMF)_xZkqqHx_iCmMjCfAiImKiCmJiCmCiCkCiCmE_xHqqkZx_
//	// EMF_xZkqqHx_iCmMiDhHiDgCiDfPjCiGiCmJiCmNiBeB_xHqqkZx_EMF_xZkqqHx_iCpAiNmEjAlGiClHiCoJiCmGiCkLiCmMiClNiCnPiCmJiBeBiDgGiDeCiDfIiDhGiDiMiDeDiCmM_xHqqkZx_
//	// _xZkqqHx_jFjN_xHqqkZx_/_xZkqqHx_iNiCiClDiCpA_xHqqkZx_pixel_xZkqqHx_iCmG_xHqqkZx_mm_xZkqqHx_iCmFiLeMjIfOiClFiCmEiCkCiCoJiBeC_xHqqkZx_
//	// _xZkqqHx_iCmCiCnMiCoIiBeBiClBiCmMjCgMiCkJiCoH_xHqqkZx_ dpm_xZkqqHx_iCpAiOfKiPgPiClFiCmEiBeBiNmEjAlGjAoGiCmMiDgGiDeCiDfIiDhGiDiMiDeDiCmM_xHqqkZx_
//	// dpm_xZkqqHx_iCmGjEoEiKhCiClFiCmEiBeBiKgHiPgLiClHiCoJiBeC_xHqqkZx_
//	// _xZkqqHx_iCmGiClBiCoLiCkKiBeB_xHqqkZx_Molip Draw _xZkqqHx_iCmFiCmNiBeB_xHqqkZx_dpm _xZkqqHx_iCpA_xHqqkZx_GetDeviceCaps(LOGPIXELSX)_xZkqqHx_iCpA_xHqqkZx_
//	// _xZkqqHx_iMlDiCmJiMhGiOfKiClFiCmEiCkCiCoJiCmMiCmFiBeBiPoDiLeMiCmMiDgGiDeCiDfIiDhGiDiMiDeDiDfEiDeDiDfJiCkJiCoHiCmMiOfKiPgPjFpLjGeA_xHqqkZx_
//	// _xZkqqHx_iCmGiCmNjCgMiCkKiClIiCoKiCmEiClFiCnMiCkEiBeC_xHqqkZx_
//	// _xZkqqHx_iClLiCmMiClNiCnPiBeBiImIiJlKiCmMiPiIjHjNiCmFiJoGjBjMiDfEiDeDiDfJiCpAiDgGiDeCiDfIiDhGiDiMiDeDiDfEiDeDiDfJiCpAiMlDiCmJ_xHqqkZx_
//	// _xZkqqHx_iClFiClNjCgMiCmJjFmPiKlHiClHiCoJiBeC_xHqqkZx_
//	// -------------------------------------------------------------
//	// Display_xZkqqHx_iCmMjIfPjHjN_xHqqkZx_mm_xZkqqHx_iCkAiClNiCoIiCmM_xHqqkZx_pixel_xZkqqHx_jAjEiCpAiMlDiCmJiMhGiOfKiClHiCoJiBeC_xHqqkZx_
//	mmetol mmRealW = mmrtFrame.Width();
//	mmetol mmRealH = mmrtFrame.Height();
//	mmown2real(mmRealW, mmRealH);
//	// HIMETRIC_xZkqqHx_iCmFiDhEiDiMiBfLiDiAiDfEiDeDiDfJiMhGiOfKiBeC_xHqqkZx_
//	CRect rtFrame100(0, 0, D2L(100 * mmRealW), D2L(100 * mmRealH));
//	// rtFrame100_xZkqqHx_iCpAiOhHjCoIiClFiCmIiCkNiCmEiCoAiOkJjDkOiCmFiMhGiOfKiClHiCoJiCkKiBeBiClBiClBiCmFjAnNjCoIiClFiClNjFpLiCkK_xHqqkZx_
//	// _xZkqqHx_jAlDiKgNiCmIjCgMiCpAjAnNjCoIiCmFiCkLiCoJiBeC_xHqqkZx_
//	// create attribute DC according to lpFormatEtc->ptd
//	hAttribDC = ::CreateDC(_T("DISPLAY"), NULL, NULL, NULL);
//	if (hAttribDC == NULL) break;
//	if (!dc.CreateEnhanced(NULL, NULL, rtFrame100, _T("Molip Draw\0Image\0\0"))) break;
//	dc.SetAttribDC(hAttribDC);
//	// _xZkqqHx_iDfIiDfOiDgCiDeOiCmJiPpDjBnEiPoOjFpBiCpAjBnCjEpAiBeC_xHqqkZx_
//	dc.SaveDC();
//	// Paint directly into the metafile.
//	BOOL bResult = OnDrawEMF(&dc, vObj, mmrtFrame);
//	// _xZkqqHx_jBnCjEpAiClFiClNiPoOjFpBiCpAjFjMiLeBiBeC_xHqqkZx_
//	dc.RestoreDC(-1);
//	if (!bResult) break;
//	// attribute DC is no longer necessary
//	dc.SetAttribDC(NULL);
//	::DeleteDC(hAttribDC);
//	hAttribDC = NULL;
//	HENHMETAFILE hEMF = dc.CloseEnhanced();
//----- 01.05.18 Fukushiro M. _xZkqqHx_jFmPiNfIiMoD_xHqqkZx_ ()-----
	HENHMETAFILE hEMF = GetCurrentSheetEMF(NULL, 0.0, 0.0, 0.0, 0.0);
//----- 01.05.18 Fukushiro M. _xZkqqHx_jFmPiNfIiPeJ_xHqqkZx_ ()-----
	if (hEMF == NULL) break;

	lpStgMedium->hEnhMetaFile = hEMF;
	lpStgMedium->tymed = TYMED_ENHMF;
	return TRUE;
} while (FALSE);
//----- 02.10.21 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ (_xZkqqHx_jFhDjHhGiCmMiClNiCnP_xHqqkZx_)-----
//	// attribute DC is no longer necessary
//	dc.SetAttribDC(NULL);
//	if (hAttribDC != NULL) ::DeleteDC(hAttribDC);
//----- 02.10.21 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ (_xZkqqHx_jFhDjHhGiCmMiClNiCnP_xHqqkZx_)-----
	return FALSE;
} // CFCMolipDrawSrvrItem::GetEnhancedMetafileData.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCMolipDrawSrvrItem::OnDrawEMF
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	EMF_xZkqqHx_jFgAiJoGiCmMiKnGjAjEiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	pDC			:_xZkqqHx_jFgAiJoGjHhAiDgGiDgPiDeDiDfIiDfCiDjDiDgFiDeMiDfIiDgHiCpAiOhHjCoIiBeC_xHqqkZx_
 *			mmrtFrame	:_xZkqqHx_jFgAiJoGiClHiCoJjFjEjFgJiCmJiKePjAnKiClHiCoJiDhEiDiMiBfLiDiAiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_jAlDiPoNiPeJjHlJiClFiClNiPoKiNiHiCmN_xHqqkZx_ 0 _xZkqqHx_iImIiKePiCpAjFnEiClFiCnMiClHiBeCiClLiCoKiImIiKePiCmMiPoKiNiHiCmN_xHqqkZx_ 0 _xZkqqHx_iCpAjFnEiClFiCnMiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	00.03.31 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
BOOL CFCMolipDrawSrvrItem::OnDrawEMF (CDC* pDC, const ObjDynabaseVector& vObj, const DBLRect& mmrtFrame)
{
	if (g_pView == NULL) return FALSE;
	if (vObj.empty()) return FALSE;

	// _xZkqqHx_iDePiDiNiBfLiDgPiDiLjFmPjAjEiCpAiDgPiDgCiDeOiDeBiDgCiDhGiBeC_xHqqkZx_
	FCGlobal global = *g_;
	const FCAutoBackup<FCGlobal*> backupGlobal(g_, &global);

	// _xZkqqHx_iDePiDiNiBfLiDgPiDiLjFmPjAjEiCmJiKgHjCkDiDiBiDfOiDhEiDeAiDeDiDiLjFgAiJoGiCmFiCkAiCoJiClBiCmGiCpAjAnNjCoIiBeC_xHqqkZx_
// 06.04.04 Fukushiro M. 1_xZkqqHx_iNhDjFmPiNfI_xHqqkZx_ ()
//	g_->eDrawWhich = FDDR_ENHANCED_METAFILE;
	const FCAutoBackup<FTDrawWhich> backupDrawWhich(g_->eDrawWhich, FDDR_ENHANCED_METAFILE);

	//------ _xZkqqHx_jFfHiPiAiCmMjAlIjDhIiCmF_xHqqkZx_Viewport_xZkqqHx_iDfEiDeDiDfJiCpAiMhGiOfK_xHqqkZx_ -----
// 02.12.12 Fukushiro M. 1_xZkqqHx_iNhDiNoNiPjM_xHqqkZx_ ()
//	const double dZoomBackup = g_->dZoom;
	g_->dZoom = g_->dDisplayPPM;

	// Viewport_xZkqqHx_iCmMiDfEiDeDiDfJiCpAiMhGiOfKiBeC_xHqqkZx_
	CSize lgszViewport(mm2lg(mmrtFrame.Width()), mm2lg(mmrtFrame.Height()));
	//------ _xZkqqHx_iClBiCoKiImIiNhOiCmN_xHqqkZx_FD_COPY_RESOLUTION_xZkqqHx_jEhLiCmMjAlIjDhIiCmFjAhNiMgAiCpAjFgAiJoG_xHqqkZx_ -----
// 05.08.19 Fukushiro M. 1_xZkqqHx_iNhDjFmPiNfI_xHqqkZx_ ()
//	g_->dZoom = g_->dDisplayPPM * g_pReg->GetCopyResolution();
	g_->dZoom = g_->dDisplayPPM * double(FD_COPY_RESOLUTION);
	// _xZkqqHx_iNmAjFfHiMgOiCpA_xHqqkZx_FD_COPY_RESOLUTION_xZkqqHx_jEhLiClFiClNiCmMiCmFiBeBiLmIjApMiCmMiMhGiOfKjAlIjDhIiCpAjHiOiCmGiClHiBeC_xHqqkZx_
//----- 05.08.19 Fukushiro M. _xZkqqHx_jFmPiNfIjBeP_xHqqkZx_ ()-----
//	if (5 < g_pReg->GetCopyResolution())
//		g_->lgdPrecision = FD_STD_PRECISION * 2 * g_pReg->GetCopyResolution();
//	else
//		g_->lgdPrecision = FD_STD_PRECISION * g_pReg->GetCopyResolution();
//----- 05.08.19 Fukushiro M. _xZkqqHx_jFmPiNfIiMoD_xHqqkZx_ ()-----
	g_->lgdPrecision = FD_STD_PRECISION * double(FD_COPY_RESOLUTION);
//----- 05.08.19 Fukushiro M. _xZkqqHx_jFmPiNfIiPeJ_xHqqkZx_ ()-----
	//----- _xZkqqHx_jFgAiJoGiDeJiDhEiDfKiDgCiDgHjCgMiCpAjAnNjCoI_xHqqkZx_ -----
//----- 02.12.12 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
//	const long lgOffsetX = g_->lgOffsetX;
//	const long lgOffsetY = g_->lgOffsetY;
//----- 02.12.12 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----
	g_->lgOffsetX = mm2lg(mmrtFrame.left);
	g_->lgOffsetY = mm2lg(mmrtFrame.top);

//----- 02.12.12 Fukushiro M. _xZkqqHx_jFmPiNfIjBeP_xHqqkZx_ ()-----
//	CPalette* pPal = g_pFDPalette;
//	g_pFDPalette = NULL;
//----- 02.12.12 Fukushiro M. _xZkqqHx_jFmPiNfIiMoD_xHqqkZx_ ()-----
	// _xZkqqHx_iDhAiDiMiDgCiDgHiCmJ_xHqqkZx_NULL_xZkqqHx_iCpAjAnNjCoIiBeC_xHqqkZx_
	const FCAutoBackup<CPalette*> backupFDPalette(g_pFDPalette, NULL);
//----- 02.12.12 Fukushiro M. _xZkqqHx_jFmPiNfIiPeJ_xHqqkZx_ ()-----

	ObjDynabaseVector::const_iterator iEnd = vObj.end();
	ObjDynabaseVector::const_iterator iObj;
	for (iObj = vObj.begin(); iObj != iEnd; iObj++)
		(*iObj)->OnDraw(pDC, FALSE);

// 02.12.12 Fukushiro M. 1_xZkqqHx_iNhDiNoNiPjM_xHqqkZx_ ()
//	g_pFDPalette = pPal;
//----- 02.12.12 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
//	//----- _xZkqqHx_jFgAiJoGiDeJiDhEiDfKiDgCiDgHiCpAjGnPiClH_xHqqkZx_ -----
//	g_->lgOffsetX = lgOffsetX;
//	g_->lgOffsetY = lgOffsetY;
//	// _xZkqqHx_iDfJiBfLiDiAiCpAjGnPiClHiBeC_xHqqkZx_
//	g_->dZoom = dZoomBackup;
//	// _xZkqqHx_iLmIjApMiCmMiMhGiOfKjAlIjDhIiCpAjGnPiClHiBeC_xHqqkZx_
//	g_->lgdPrecision = FD_STD_PRECISION;
//	// _xZkqqHx_iDiBiDfOiDhEiDeAiDeDiDiLjFgAiJoGiPeJjHlJiClFiBeBiMlDiCmJjGnPiClHiBeC_xHqqkZx_
//	g_->eDrawWhich = eDrawWhichBack;
//----- 02.12.12 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----

	//----- _xZkqqHx_iDiBiDgCiDfKiBfLiDfHiDhAiDgMiDiLiCmMjFfMiOkG_xHqqkZx_ -----
	// %d _xZkqqHx_jEhLiCmMiJpAjBjMjDhIiCmFiDeDiDiBiBfLiDfHiCpAiDfCiDhDiBfLiClFiCnMiClFiClNiBeC_xHqqkZx_
	FFShowMsgPanel(IDS_MSG_COPY_IMAGE);
	return TRUE;
} // CFCMolipDrawSrvrItem::OnDrawEMF.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCMolipDrawSrvrItem::OnDrawWMF
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iCgOiCgLiCgEiDfEiBfLiDgPiLeAjEfMiCmMjFgAiJoGiKnGjAjEiBeCiCgOiCgLiCgEiDgGiBfLiDfOiCmJjDfJjFhEiClHiCoJiDiBiDfOiDhEiDeAiDeDiDiL_xHqqkZx_
 *			_xZkqqHx_iCmMjFgAiJoGiCpAiNhDiCkEiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	pDC		:_xZkqqHx_jFgAiJoGjHhAiDgGiDgPiDeDiDfIiDfCiDjDiDgFiDeMiDfIiDgHiBeC_xHqqkZx_
 *			rSize	:_xZkqqHx_iDiBiDfOiDhEiDeAiDeDiDiLiCmMiDfEiDeDiDfJiCpAjFnEiClHiBeC_xHqqkZx_HIMETRIC_xZkqqHx_jCfAiImKiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_jAlDiPoNiPeJjHlJiClFiClNiPoKiNiHiCmN_xHqqkZx_ 0 _xZkqqHx_iImIiKePiCpAjFnEiClFiCnMiClHiBeCiClLiCoKiImIiKePiCmMiPoKiNiHiCmN_xHqqkZx_ 0 _xZkqqHx_iCpAjFnEiClFiCnMiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jCiNiInD_xHqqkZx_>	_xZkqqHx_jDfJjFhEiClDiCoKiClNiDiBiDfOiDhEiDeAiDeDiDiLiCmNiBeBiDhJiBfLiDfIiDgHjBkEiDeBiDhGiDiKiCmFiCmMjFfMiOkGiBeFiIpDiNpMiCmJ_xHqqkZx_
 *			_xZkqqHx_iOgHiCoNiCoKiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	99.04.30 Fukushiro M. _xZkqqHx_iDfCiDiBiDjDiDgHiNoMjAkM_xHqqkZx_
 *************************************************************************/
BOOL CFCMolipDrawSrvrItem::OnDrawWMF (CDC* pDC, CSize& rSize)
{
	if (g_pView == NULL) return FALSE;
	ObjDynabaseVector vObj;
	DBLRect mmrtFrame;
	// rSize_xZkqqHx_iCmN_xHqqkZx_ HIMETRIC _xZkqqHx_jCfAiImKiCmFjFnEiClDiCmIiCkPiCoKiCmOiCmIiCoHiCmIiCkCiClBiCmGiCpAiNgMjHlGiClFiCmEiBeB_xHqqkZx_
	// _xZkqqHx_jFjEjFgJiNmFjBoFiNmAjFfHjCgMiCpAiLhEiOfKiClHiCoJiBeC_xHqqkZx_
	CSize rSizeMax(32700, 32700);
	// _xZkqqHx_jBfDiCmEiCmMiChJiDeJiBfLiDfPiBfLiCpAiOoGjDlOiBeC_xHqqkZx_
	FCZOrder zOrder;
	g_pDoc->GetZOrder(zOrder, FDOZ_ON_ANY);
	// _xZkqqHx_iDhJiBfLiDfIiDgHiJmCjEfMiCmIjFjEjFgJiCmGiBeBiKePjAnKiDhEiDiMiBfLiDiAiCpAiMhGiOfKiBeC_xHqqkZx_
	if (!GetPasteObjFrame(vObj, mmrtFrame, &zOrder, rSizeMax.cx, rSizeMax.cy))
		AfxGetMainWnd()->PostMessage(WM_USER_COPY_WARNING);
	// _xZkqqHx_iBhFiDeJiDhFiDfHiDeGiDeOiDgHiCmMiNoMjAkMiCmGjDfMiCoIjFhEiCkPiBhGiCkJiCoHiOmAiNhDiClFiClNiPoKiNiHiCmNiBeBiNmFiPiJiCmJ_xHqqkZx_ OnDraw_xZkqqHx_iCkK_xHqqkZx_
	// _xZkqqHx_iOmAiNhDiClDiCoKiCoJiClNiCnPiBeBjFjEjFgJiCkKiLpDiCmFiCoAiClBiClBiCmJjHiIiCoJiBeC_xHqqkZx_
	if (vObj.empty())
	{
		// _xZkqqHx_jDeLjDjGiCmJiBeB_xHqqkZx_100x100_xZkqqHx_iCpAjAnNjCoIiBeC_xHqqkZx_
		rSize = CSize(100, 100);
		// rSize_xZkqqHx_iCmN_xHqqkZx_ HIMETRIC _xZkqqHx_jCfAiImKiCmFjFnEiClDiCmIiCkPiCoKiCmOiCmIiCoHiCmIiCkCiClNiCnPiBeBjFmPiKlHiBeC_xHqqkZx_
		pDC->LPtoHIMETRIC(&rSize);
		 return TRUE;
	}
	//----- DisplayPPM_xZkqqHx_iCkKiInJiCmIiCoJiPoKiNiHiCkKiCkAiCoJiBeCiBhFiDeJiDhFiDfHiDeGiDeOiDgHiCmMjBhNjDpMiBhGiBhFiDhEiDeAiDeDiDiLiCkJiCoHiBhGiCmIiCmH_xHqqkZx_ -----
//----- 02.12.07 Fukushiro M. _xZkqqHx_jFmPiNfIjBeP_xHqqkZx_ ()-----
//	const double dDisplayPPM = g_->dDisplayPPM;
//	const double dRealDisplayPPMHorz = g_->dRealDisplayPPMHorz;
//	const double dRealDisplayPPMVert = g_->dRealDisplayPPMVert;
//----- 02.12.07 Fukushiro M. _xZkqqHx_jFmPiNfIiMoD_xHqqkZx_ ()-----
	// _xZkqqHx_iDePiDiNiBfLiDgPiDiLjFmPjAjEiCpAiDgPiDgCiDeOiDeBiDgCiDhGiBeC_xHqqkZx_
	FCGlobal global = *g_;
	const FCAutoBackup<FCGlobal*> backupGlobal(g_, &global);
//----- 02.12.07 Fukushiro M. _xZkqqHx_jFmPiNfIiPeJ_xHqqkZx_ ()-----
	g_->dDisplayPPM = (double)pDC->GetDeviceCaps(LOGPIXELSX) / 25.4;
	g_->dRealDisplayPPMHorz = double(pDC->GetDeviceCaps(HORZRES)) /
									double(pDC->GetDeviceCaps(HORZSIZE));
	g_->dRealDisplayPPMVert = double(pDC->GetDeviceCaps(VERTRES)) /
									double(pDC->GetDeviceCaps(VERTSIZE));
	// _xZkqqHx_iDfIiDfOiDgCiDeOiCmJiPpDjBnEiPoOjFpBiCpAjBnCjEpAiBeC_xHqqkZx_
	pDC->SaveDC();
	// TODO: _xZkqqHx_iDhNiDgCiDhDiDjDiDeP_xHqqkZx_ _xZkqqHx_iDiCiBfLiDgIiCmGjEmNiImNiCmMjAnNjCoIiBeC_xHqqkZx_
	//  (_xZkqqHx_jEmNiImNiCmNjCmKiPoN_xHqqkZx_ OnGetExtent _xZkqqHx_iCkJiCoHjFnEiClDiCoKiClNiDfEiDeDiDfJiCmGjDkPiClGiCmFiClH_xHqqkZx_)
	pDC->SetMapMode(MM_ANISOTROPIC);
	// _xZkqqHx_iDePiDiNiBfLiDgPiDiLjFmPjAjEiCmJiDiBiDfOiDhEiDeAiDeDiDiLjFgAiJoGiCmFiCkAiCoJiClBiCmGiCpAjAnNjCoIiBeC_xHqqkZx_
// 06.04.04 Fukushiro M. 1_xZkqqHx_iNhDjFmPiNfI_xHqqkZx_ ()
//	g_->eDrawWhich = FDDR_METAFILE;
	const FCAutoBackup<FTDrawWhich> backupDrawWhich(g_->eDrawWhich, FDDR_METAFILE);

	//------ _xZkqqHx_jCmKiPoNiCmM_xHqqkZx_DisplayPPM(_xZkqqHx_jBkGiClP_xHqqkZx_1_xZkqqHx_jEhL_xHqqkZx_)_xZkqqHx_iCmFiMhGiOfKiClHiCoJiClNiCnPiBeBiDfJiBfLiDiAiCpAjAnNjCoI_xHqqkZx_ -----
// 02.12.12 Fukushiro M. 1_xZkqqHx_iNhDiNoNiPjM_xHqqkZx_ ()
//	const double dZoomBackup = g_->dZoom;
	g_->dZoom = g_->dDisplayPPM;
	//------ rSize_xZkqqHx_iCmJjCmKiPoNiCmM_xHqqkZx_DisplayPPM(_xZkqqHx_jBkGiClP_xHqqkZx_1_xZkqqHx_jEhL_xHqqkZx_)_xZkqqHx_iCmFiMhGiOfKiClFiClNjAhNiMgAiDfEiDeDiDfJiCpAjAnNjCoI_xHqqkZx_ -----
	rSize.cx = mm2lg(mmrtFrame.Width());
	rSize.cy = mm2lg(mmrtFrame.Height());

	//------ _xZkqqHx_iClBiCoKiImIiNhOiCmN_xHqqkZx_FD_COPY_RESOLUTION_xZkqqHx_jEhLiCmMjAlIjDhIiCmFjAhNiMgAiCpAjFgAiJoG_xHqqkZx_ -----
// 05.08.19 Fukushiro M. 1_xZkqqHx_iNhDjFmPiNfI_xHqqkZx_ ()
//	g_->dZoom = g_->dDisplayPPM * g_pReg->GetCopyResolution();
	g_->dZoom = g_->dDisplayPPM * double(FD_COPY_RESOLUTION);
	// _xZkqqHx_iNmAjFfHiMgOiCpA_xHqqkZx_FD_COPY_RESOLUTION_xZkqqHx_jEhLiClFiClNiCmMiCmFiBeBiLmIjApMiCmMiMhGiOfKjAlIjDhIiCpAjHiOiCmGiClHiBeC_xHqqkZx_
//----- 05.08.19 Fukushiro M. _xZkqqHx_jFmPiNfIjBeP_xHqqkZx_ ()-----
//	if (5 < g_pReg->GetCopyResolution())
//		g_->lgdPrecision = FD_STD_PRECISION * 2 * g_pReg->GetCopyResolution();
//	else
//		g_->lgdPrecision = FD_STD_PRECISION * g_pReg->GetCopyResolution();
//----- 05.08.19 Fukushiro M. _xZkqqHx_jFmPiNfIiMoD_xHqqkZx_ ()-----
	g_->lgdPrecision = FD_STD_PRECISION * double(FD_COPY_RESOLUTION);
//----- 05.08.19 Fukushiro M. _xZkqqHx_jFmPiNfIiPeJ_xHqqkZx_ ()-----
	CSize lgSize10(mm2lg(mmrtFrame.Width()), mm2lg(mmrtFrame.Height()));
	if (lgSize10.cx <= 0) lgSize10.cx = 1;
	if (lgSize10.cy <= 0) lgSize10.cy = 1;

	//----- _xZkqqHx_jFgAiJoGiDeJiDhEiDfKiDgCiDgHjCgMiCpAjAnNjCoI_xHqqkZx_ -----
//----- 02.12.12 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
//	const long lgOffsetX = g_->lgOffsetX;
//	const long lgOffsetY = g_->lgOffsetY;
//----- 02.12.12 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----
	g_->lgOffsetX = mm2lg(mmrtFrame.left);
	g_->lgOffsetY = mm2lg(mmrtFrame.top);
	pDC->SetWindowOrg(0, 0);
	pDC->SetWindowExt(lgSize10);
	pDC->SetViewportOrg(0, 0);
	pDC->SetViewportExt(lgSize10);
	// rSize_xZkqqHx_iCmN_xHqqkZx_ HIMETRIC _xZkqqHx_jCfAiImKiCmFjFnEiClDiCmIiCkPiCoKiCmOiCmIiCoHiCmIiCkCiClNiCnPiBeBjFmPiKlHiBeC_xHqqkZx_
	pDC->LPtoHIMETRIC(&rSize);

//----- 02.12.12 Fukushiro M. _xZkqqHx_jFmPiNfIjBeP_xHqqkZx_ ()-----
//	CPalette* pPal = g_pFDPalette;
//	g_pFDPalette = NULL;
//----- 02.12.12 Fukushiro M. _xZkqqHx_jFmPiNfIiMoD_xHqqkZx_ ()-----
	// _xZkqqHx_iDhAiDiMiDgCiDgHiCmJ_xHqqkZx_NULL_xZkqqHx_iCpAjAnNjCoIiBeC_xHqqkZx_
	const FCAutoBackup<CPalette*> backupFDPalette(g_pFDPalette, NULL);
//----- 02.12.12 Fukushiro M. _xZkqqHx_jFmPiNfIiPeJ_xHqqkZx_ ()-----
	ObjDynabaseVector::const_iterator iEnd = vObj.end();
	ObjDynabaseVector::const_iterator iObj;
	for (iObj = vObj.begin(); iObj != iEnd; iObj++)
		(*iObj)->OnDraw(pDC, FALSE);

// 02.12.12 Fukushiro M. 1_xZkqqHx_iNhDiNoNiPjM_xHqqkZx_ ()
//	g_pFDPalette = pPal;

//----- 02.12.12 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
//	//----- _xZkqqHx_jFgAiJoGiDeJiDhEiDfKiDgCiDgHiCpAjGnPiClH_xHqqkZx_ -----
//	g_->lgOffsetX = lgOffsetX;
//	g_->lgOffsetY = lgOffsetY;
//
//	g_->dZoom = dZoomBackup;
//	// _xZkqqHx_iLmIjApMiCmMiMhGiOfKjAlIjDhIiCpAjGnPiClHiBeC_xHqqkZx_
//	g_->lgdPrecision = FD_STD_PRECISION;
//
//	// _xZkqqHx_iDiBiDfOiDhEiDeAiDeDiDiLjFgAiJoGiPeJjHlJiClFiBeBiMlDiCmJjGnPiClHiBeC_xHqqkZx_
//	g_->eDrawWhich = eDrawWhichBack;
//----- 02.12.12 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----

	// _xZkqqHx_jBnCjEpAiClFiClNiPoOjFpBiCpAjFjMiLeB_xHqqkZx_.
	pDC->RestoreDC(-1);

	//----- DisplayPPM_xZkqqHx_iCpAjFjMiLeB_xHqqkZx_ -----
//----- 02.12.07 Fukushiro M. _xZkqqHx_jFmPiNfIjBeP_xHqqkZx_ ()-----
//	g_->dDisplayPPM = dDisplayPPM;
//	g_->dRealDisplayPPMHorz = dRealDisplayPPMHorz;
//	g_->dRealDisplayPPMVert = dRealDisplayPPMVert;
//----- 02.12.07 Fukushiro M. _xZkqqHx_jFmPiNfIiMoD_xHqqkZx_ ()-----
// 02.12.12 Fukushiro M. 1_xZkqqHx_iNhDiNoNiPjM_xHqqkZx_ ()
//	*g_ = globalOrig;
//----- 02.12.07 Fukushiro M. _xZkqqHx_jFmPiNfIiPeJ_xHqqkZx_ ()-----

//----- 01.06.24 Fukushiro M. _xZkqqHx_jCmHiJmBiOgO_xHqqkZx_ ()-----
	//----- _xZkqqHx_iDiBiDgCiDfKiBfLiDfHiDhAiDgMiDiLiCmMjFfMiOkG_xHqqkZx_ -----
	// %d _xZkqqHx_jEhLiCmMiJpAjBjMjDhIiCmFiDeDiDiBiBfLiDfHiCpAiDfCiDhDiBfLiClFiCnMiClFiClNiBeC_xHqqkZx_
	FFShowMsgPanel(IDS_MSG_COPY_IMAGE);
//----- 01.06.24 Fukushiro M. _xZkqqHx_jCmHiJmBiPeJ_xHqqkZx_ ()-----
	return TRUE;
} // CFCMolipDrawSrvrItem::OnDrawWMF.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCMolipDrawSrvrItem::GetPasteObjFrame
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_jDfMiCoIjFhEiCkPiJmCjEfMiCmIjFjEjFgJiCmGiKePjAnKiDhEiDiMiBfLiDiAiCpAiMhGiOfKiClFiCmEjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	vObj		:_xZkqqHx_jFjEjFgJiCpAjFnEiClHiBeC_xHqqkZx_
 *			mmrtFrame	:_xZkqqHx_iKePjAnKiDhEiDiMiBfLiDiAiCpAjFnEiClHiBeC_xHqqkZx_
 *			pZOrder		:_xZkqqHx_jDfMiCoIjFhEiCkPjBmOiPnLiCmMjFjEjFgJiCpAiOhHjCoIiBeC_xHqqkZx_
 *			lMaxCX		:_xZkqqHx_iOhHjCoIiJpAjBjMjDhIiCmFiBeBjFjEjFgJiCkKiNmFjBoFiCmJiCmGiCoIjDlOiCoJiNmAjFfHiPoDiMmAiCpAiOhHjCoIiBeC_xHqqkZx_
 *			lMaxCY		:_xZkqqHx_iOhHjCoIiJpAjBjMjDhIiCmFiBeBjFjEjFgJiCkKiNmFjBoFiCmJiCmGiCoIjDlOiCoJiNmAjFfHiPoDiMmAiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_jFjEjFgJiCmMiDfCiDhDiBfLiCkKiIoKiCmCiCmFiCoAiPoDiMmAiCmJiCkJiCkJiCmBiCmEiMiHiCkPiClNiPoKiNiHiCmN_xHqqkZx_ FALSE_xZkqqHx_iBeC_xHqqkZx_
 *
 * <_xZkqqHx_iJpAjAoA_xHqqkZx_>	short_xZkqqHx_iCmMiNmFjBoFjCgMiCkK_xHqqkZx_WMF_xZkqqHx_iCmMiMmAjDhIiCmIiCmMiCmFiBeBiClLiCoKiCmJiOpLiCnMiCoJjFjEjFgJiCmMiCnNjBeJjBpAiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	00.08.24 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
BOOL CFCMolipDrawSrvrItem::GetPasteObjFrame (ObjDynabaseVector& vObj, DBLRect& mmrtFrame,
											const FCZOrder* pZOrder,
											long lMaxCX, long lMaxCY)
{
	BOOL bFail = FALSE;	// _xZkqqHx_jFjEjFgJiCkKjAkHiMmAiCmJiIpIiCmBiCkJiCkJiCmBiClNiBeI_xHqqkZx_
	//----- _xZkqqHx_iKePjAnKiDhEiDiMiBfLiDiAiCmMiNlGiPoDiNmAjFfHiCpAiOfKiPgP_xHqqkZx_ -----
	DBLPoint mmptLT(DBL_MAX, DBL_MAX);
	FCZOrderIterator iObj;
	for (pZOrder->Begin(iObj); !iObj.IsEnd(); iObj++)
	{
		DBLRect mmrtTmp = (*iObj)->CalcExactOuterFrame();
		if (mmrtTmp.left < mmptLT.x) mmptLT.x = mmrtTmp.left;
		if (mmrtTmp.top < mmptLT.y)  mmptLT.y = mmrtTmp.top;
	}
//----- 02.10.19 Fukushiro M. _xZkqqHx_jFmPiNfIjBeP_xHqqkZx_ (_xZkqqHx_iDfCiDhDiBfLiOjOiCmMiKgHjCkDiDiBiDfOiDhEiDeAiDeDiDiLiCmMiDfEiDeDiDfJiPoOjFpBiMhGiOfKiCmFiBeBiDfJiBfLiDiAjCgMiCmJiKnGiClHiCoJiMoLiCoIiCkKiCkAiCoJiBeC_xHqqkZx_)-----
//	//------ _xZkqqHx_jCmKiPoNiCmM_xHqqkZx_DisplayPPM(_xZkqqHx_jBkGiClP_xHqqkZx_1_xZkqqHx_jEhL_xHqqkZx_)_xZkqqHx_iCmFiMhGiOfKiClHiCoJiClNiCnPiBeBiDfJiBfLiDiAiCpAjAnNjCoI_xHqqkZx_ -----
//	const double dZoomBackup = g_->dZoom;
//	g_->dZoom = g_->dDisplayPPM;
//	//----- _xZkqqHx_jCmKiPoNiCmMiDfEiDeDiDfJiCmFiBeB_xHqqkZx_1 pixel_xZkqqHx_iCpAiNlGiPoDiCkJiCoHiMlIiOfKiBeC_xHqqkZx_WORD_xZkqqHx_jDjJiCmFiBeB_xHqqkZx_50%_xZkqqHx_iCmFjFfMiOkGiCpAiKoOiPiAiCmJiMgPiMlBjDeJjCgM_xHqqkZx_ -----
//	mmptLT.x -= lg2mm(1);
//	mmptLT.y -= lg2mm(1);
//	//------ _xZkqqHx_iClBiCoKiImIiNhOiCmN_xHqqkZx_g_pReg->GetCopyResolution()_xZkqqHx_jEhLiCmMjAlIjDhIiCmFiMhGiOfK_xHqqkZx_ -----
//----- 02.10.19 Fukushiro M. _xZkqqHx_jFmPiNfIiMoD_xHqqkZx_ (_xZkqqHx_iDfCiDhDiBfLiOjOiCmMiKgHjCkDiDiBiDfOiDhEiDeAiDeDiDiLiCmMiDfEiDeDiDfJiPoOjFpBiMhGiOfKiCmFiBeBiDfJiBfLiDiAjCgMiCmJiKnGiClHiCoJiMoLiCoIiCkKiCkAiCoJiBeC_xHqqkZx_)-----
	//----- _xZkqqHx_jCmKiPoNiCmMiDfEiDeDiDfJiCmFiBeB_xHqqkZx_1 pixel_xZkqqHx_iCpAiNlGiPoDiCkJiCoHiMlIiOfKiBeC_xHqqkZx_WORD_xZkqqHx_jDjJiCmFiBeB_xHqqkZx_50%_xZkqqHx_iCmFjFfMiOkGiCpAiKoOiPiAiCmJiMgPiMlBjDeJjCgM_xHqqkZx_ -----
	mmptLT.x -= lg2mm(1, g_->dDisplayPPM);
	mmptLT.y -= lg2mm(1, g_->dDisplayPPM);
	//------ _xZkqqHx_iClBiCoKiImIiNhOiCmN_xHqqkZx_FD_COPY_RESOLUTION_xZkqqHx_jEhLiCmMjAlIjDhIiCmFiMhGiOfK_xHqqkZx_ -----
	const double dZoomBackup = g_->dZoom;
//----- 02.10.19 Fukushiro M. _xZkqqHx_jFmPiNfIiPeJ_xHqqkZx_ (_xZkqqHx_iDfCiDhDiBfLiOjOiCmMiKgHjCkDiDiBiDfOiDhEiDeAiDeDiDiLiCmMiDfEiDeDiDfJiPoOjFpBiMhGiOfKiCmFiBeBiDfJiBfLiDiAjCgMiCmJiKnGiClHiCoJiMoLiCoIiCkKiCkAiCoJiBeC_xHqqkZx_)-----
// 05.08.19 Fukushiro M. 1_xZkqqHx_iNhDjFmPiNfI_xHqqkZx_ ()
//	g_->dZoom = g_->dDisplayPPM * g_pReg->GetCopyResolution();
	g_->dZoom = g_->dDisplayPPM * double(FD_COPY_RESOLUTION);
	//----- _xZkqqHx_jFgAiJoGiDeJiDhEiDfKiDgCiDgHjCgMiCpAjAnNjCoI_xHqqkZx_ -----
	const long lgOffsetX = g_->lgOffsetX;
	const long lgOffsetY = g_->lgOffsetY;
	g_->lgOffsetX = mm2lg(mmptLT.x);
	g_->lgOffsetY = mm2lg(mmptLT.y);

	mmrtFrame.SetRect(DBL_MAX, DBL_MAX, -DBL_MAX, -DBL_MAX);
	vObj.clear();
	for (pZOrder->Begin(iObj); !iObj.IsEnd(); iObj++)
	{
		DBLRect mmrtTmp = (*iObj)->CalcExactOuterFrame();
		CRect dvrtTmp = mm2lg(mmrtTmp);
		g_pView->LPtoDP(dvrtTmp);
		//----- lMaxCX/lMaxCY_xZkqqHx_iImIiJlKiCmMjAhNiCmMiCnNiDfCiDhDiBfL_xHqqkZx_ -----
		if (lMaxCX < dvrtTmp.right || lMaxCY <  dvrtTmp.bottom)
		{
			bFail = TRUE;	// _xZkqqHx_jFjEjFgJiCkKjAkHiMmAiCmJiIpIiCmBiCkJiCkJiCmBiClNiBeI_xHqqkZx_
			continue;
		}
		vObj.push_back(*iObj);
		if (mmrtTmp.left < mmrtFrame.left)		mmrtFrame.left = mmrtTmp.left;
		if (mmrtTmp.top < mmrtFrame.top)		mmrtFrame.top = mmrtTmp.top;
		if (mmrtFrame.right < mmrtTmp.right)	mmrtFrame.right = mmrtTmp.right;
		if (mmrtFrame.bottom < mmrtTmp.bottom)	mmrtFrame.bottom = mmrtTmp.bottom;
	}
	//----- _xZkqqHx_jFgAiJoGiDeJiDhEiDfKiDgCiDgHiCpAjGnPiClH_xHqqkZx_ -----
	g_->lgOffsetX = lgOffsetX;
	g_->lgOffsetY = lgOffsetY;
	// _xZkqqHx_iDfJiBfLiDiAiCpAjGnPiClHiBeC_xHqqkZx_
	g_->dZoom = dZoomBackup;
	// _xZkqqHx_jCmKiPoNiCmMiDfEiDeDiDfJiCmFiBeB_xHqqkZx_1 pixel_xZkqqHx_iCpAiKgHjBoFiBeC_xHqqkZx_WORD_xZkqqHx_jDjJiCmFiBeB_xHqqkZx_50%_xZkqqHx_iCmFjFfMiOkGiCpAiKoOiPiAiCmJiMgPiMlBjDeJjCgMiBeC_xHqqkZx_
// 02.10.19 Fukushiro M. 1_xZkqqHx_iNhDjFmPiNfI_xHqqkZx_ (_xZkqqHx_iDfCiDhDiBfLiOjOiCmMiKgHjCkDiDiBiDfOiDhEiDeAiDeDiDiLiCmMiDfEiDeDiDfJiPoOjFpBiMhGiOfKiCmFiBeBiDfJiBfLiDiAjCgMiCmJiKnGiClHiCoJiMoLiCoIiCkKiCkAiCoJiBeC_xHqqkZx_)
//	mmrtFrame.Extend(lg2mm(1));
	mmrtFrame.Extend(lg2mm(1, g_->dDisplayPPM));
	return !bFail;
} // CFCMolipDrawSrvrItem::GetPasteObjFrame.

CFCMolipDrawSrvrItem::~CFCMolipDrawSrvrItem ()
{
	// TODO: _xZkqqHx_iClBiCmMiPoKiPiKiCmJiMoDiPiIjHjNiCpAjCmHiJmBiClFiCmEiCkNiClOiClDiCkCiBeC_xHqqkZx_
} // CFCMolipDrawSrvrItem::~CFCMolipDrawSrvrItem.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCMolipDrawSrvrItem::Serialize
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDfCiDhDiBfLiOjOiCmMiDfGiDiKiDeBiDiJiDeDiDfJiPiIjHjNiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	ar	:_xZkqqHx_iDeBiBfLiDeKiDeDiDhFiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	00.11.27 Fukushiro M. _xZkqqHx_iDfCiDiBiDjDiDgHiNoMjAkM_xHqqkZx_
 *************************************************************************/
void CFCMolipDrawSrvrItem::Serialize (CArchive& ar)
{
	// CFCMolipDrawSrvrItem::Serialize _xZkqqHx_iCmNiDeBiDeDiDgFiDiAiCkKiDeOiDiKiDgCiDhGiDhLiBfLiDgIiCmJiDfCiDhDiBfLiClD_xHqqkZx_
	// _xZkqqHx_iCoKiCmEiCkCiCoJiCmGiCkLiCmJiCmNiBeBiDhEiDiMiBfLiDiAiDiPiBfLiDeOiCmJiCoGiCmBiCmEiMmEiCmOiCoKiCnMiClHiBeCiClBiCoKiCmN_xHqqkZx_ OLE _xZkqqHx_iDfCiBfLiDiL_xHqqkZx_
	// _xZkqqHx_iDgPiDgCiDeO_xHqqkZx_ OnGetClipboardData _xZkqqHx_iCpAjCmKiCoIiJhKiClFiCmEiOkJjDkOjDeJiCmJiNhDiCoNiClJiCoJiClBiCmGiCkKiCmFiCkLiCnMiClHiBeC_xHqqkZx_
	// _xZkqqHx_jGiEiCnPiNjOiCnNiDeBiDeDiDgFiDiAiCmMiDgGiDhEiDeIiDiLiDgHiCmNiKmIjCfAiCmIiDgIiDeMiDiFiDiBiDjDiDgHiCmMiDfGiDiKiDeBiDiJiDeDiDfJiKnGjAjEiCmMjBoD_xHqqkZx_
	// _xZkqqHx_iCoNiCoIiCpAiClFiCnMiClHiBeC_xHqqkZx_
	// _xZkqqHx_iDiKiDjDiDeOiCpAiDfEiDhMiBfLiDgHiClFiCmEiCkCiCoJiCmGiCkLiCmNiBeBiDgIiDeMiDiFiDiBiDjDiDgHiCmMiIoKjFjEiCpAiDfGiDiKiDeBiDiJiDeDiDfJiClFiCnMiClHiBeC_xHqqkZx_

//----- 03.08.31 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
//	CFCFoundDoc* pDoc = g_pDoc;
//	ASSERT_VALID(pDoc);
//----- 03.08.31 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----

	if (!IsLinkedItem())
	{
//----- 00.08.25 Fukushiro M. _xZkqqHx_jFmPiNfIjBeP_xHqqkZx_ ()-----
//		POSITION pos = pDoc->GetFirstViewPosition();
//		if (pos == NULL) return;
//		CFCDynamicDrawView* pView = (CFCDynamicDrawView*)pDoc->GetNextView(pos);
//		ASSERT_VALID(pView);
//		ASSERT(pView->IsKindOf(RUNTIME_CLASS(CFCDynamicDrawView)));
//		if (ar.IsStoring())
//		{
//			pDoc->OutHeader(ar);
//			// _xZkqqHx_iDhGiDiKiDjDiDfOiPoOjFpBjDjJiCpAiPjBiCkLiPgPiClHiBeC_xHqqkZx_
//			theApp.OutStream(ar);
//			// _xZkqqHx_iKmCiLkLiPoOjFpBiCpAiPjBiCkLiPgPiClHiBeC_xHqqkZx_
//			g_pEnv->OutStream(ar);
//			// _xZkqqHx_iDgDiBfLiDiLjAnNjCoIiPoOjFpBiCpAiPjBiCkLiPgPiClHiBeC_xHqqkZx_
//			g_pView->OutStream(ar);
//			g_pEnv->GetChipManager()->OutStream(ar);
//			pDoc->OutStream(ar);
//			// _xZkqqHx_iDiKiDjDiDeOiPoOjFpBiCpAiPgPjHmNiClHiCoJiBeC_xHqqkZx_
//			pDoc->LinkManager()->OutStream(ar);
//		} else
//		{
//			// _xZkqqHx_iDfIiDgHiDiKiBfLiDiAjDpMjHmNjBePiPiIjHjNiBeC_xHqqkZx_
//			pView->PrepareStreamIn();
//			(void)pDoc->InHeader(ar);
//			g_pEnv->InStream(ar);
//			// _xZkqqHx_iDgDiBfLiDiLjAnNjCoIiPoOjFpBiCpAjDmHiCnNiNjOiCnOiBeC_xHqqkZx_
//			g_pView->InStream(ar);
//			g_pEnv->GetChipManager()->InStream(ar);
//			pDoc->InStream(ar);
//			// _xZkqqHx_iDiKiDjDiDeOiPoOjFpBiCpAjDpMjHmNiClHiCoJiBeC_xHqqkZx_
//			pDoc->LinkManager()->InStream(ar);
//			// FDEnv_xZkqqHx_iCmMiDfGiBfLiDgHiDfEiDeDiDfJjFmPiNfIiCpAjFfMiOkGiCmJjElNiJgGiBeC_xHqqkZx_
//			g_pView->UpdateScrollSize();
//		}
//		pDoc->COleServerDoc::Serialize(ar);
//----- 00.08.25 Fukushiro M. _xZkqqHx_jFmPiNfIiMoD_xHqqkZx_ ()-----
//----- 02.05.29 Fukushiro M. _xZkqqHx_jFmPiNfIjBeP_xHqqkZx_ (WORD2000_xZkqqHx_iCmJ_xHqqkZx_DD3_xZkqqHx_jFlGiPjBiCpA_xHqqkZx_OLE_xZkqqHx_jDfMiCoIjFhEiCkPiBeC_xHqqkZx_DClick_xZkqqHx_iCmFjFnCiPfHiPpDjBnEiCmJiClFiCmEiBeBjFjEjFgJiCpAiCfAiMmCiDfCiDhDiBfLiClFiCmEiClHiCkOiPeJjHlJiBeCiDfCiDhDiBfLiClFiClNjFjEjFgJiClOiCkPiCmJiCmIiCoJiBeC_xHqqkZx_)-----
//		pDoc->Serialize(ar);
//----- 02.05.29 Fukushiro M. _xZkqqHx_jFmPiNfIiMoD_xHqqkZx_ (WORD2000_xZkqqHx_iCmJ_xHqqkZx_DD3_xZkqqHx_jFlGiPjBiCpA_xHqqkZx_OLE_xZkqqHx_jDfMiCoIjFhEiCkPiBeC_xHqqkZx_DClick_xZkqqHx_iCmFjFnCiPfHiPpDjBnEiCmJiClFiCmEiBeBjFjEjFgJiCpAiCfAiMmCiDfCiDhDiBfLiClFiCmEiClHiCkOiPeJjHlJiBeCiDfCiDhDiBfLiClFiClNjFjEjFgJiClOiCkPiCmJiCmIiCoJiBeC_xHqqkZx_)-----
		// _xZkqqHx_iClBiClBiCmFiCmNiBeBjClMjAnKiCmJ_xHqqkZx_ CFCFoundDoc::Serialize _xZkqqHx_iCpAiMmEiCnBiPgPiClFiCmEiCmNiCkCiCkPiCmIiCkCiBeC_xHqqkZx_
		// UpdateAllItems_xZkqqHx_iKnGjAjEiCkKiOmAiNhDiClDiCoKiCmEiClFiCnMiCkEiClNiCnPiBeC_xHqqkZx_UpdateAllItems_xZkqqHx_iKnGjAjEiCkKiOmAiNhDiClDiCoKiCoJiCmG_xHqqkZx_
		// _xZkqqHx_iPjBiCkLiPgPiClFiClNiDgGiBfLiDfOiCkKiMmEiCnBiPgPiClFiMlD_xHqqkZx_OLE_xZkqqHx_iDeJiDhFiDfHiDeGiDeOiDgHiCmJjElNiJgGiClDiCoKiCmEiClFiCnMiCkEiBeC_xHqqkZx_
		// _xZkqqHx_jBkGiClPiBeBiDfCiDhDiBfLiClFiClNjFjEjFgJiCmMiCnNiCkK_xHqqkZx_OLE_xZkqqHx_iDeJiDhFiDfHiDeGiDeOiDgHiCmJjFfMiOkGiClDiCoKiCoJiBeC_xHqqkZx_
		if (ar.IsStoring())
		//----- _xZkqqHx_iDgGiBfLiDfOiPjBiCkLiPgPiClFiCmMiPoKiNiH_xHqqkZx_ -----
		{
			g_pDoc->OutCurrentCcoreFormat(FCUndoArchive(ar));
		}
		else
		//----- _xZkqqHx_iDgGiBfLiDfOjDmHiCnNiNjOiCnNiCmMiPoKiNiH_xHqqkZx_ -----
		{
			g_pDoc->InCurrentCcoreFormat(FCUndoArchive(ar));
		}
//----- 02.05.29 Fukushiro M. _xZkqqHx_jFmPiNfIiPeJ_xHqqkZx_ (WORD2000_xZkqqHx_iCmJ_xHqqkZx_DD3_xZkqqHx_jFlGiPjBiCpA_xHqqkZx_OLE_xZkqqHx_jDfMiCoIjFhEiCkPiBeC_xHqqkZx_DClick_xZkqqHx_iCmFjFnCiPfHiPpDjBnEiCmJiClFiCmEiBeBjFjEjFgJiCpAiCfAiMmCiDfCiDhDiBfLiClFiCmEiClHiCkOiPeJjHlJiBeCiDfCiDhDiBfLiClFiClNjFjEjFgJiClOiCkPiCmJiCmIiCoJiBeC_xHqqkZx_)-----
//----- 00.08.25 Fukushiro M. _xZkqqHx_jFmPiNfIiPeJ_xHqqkZx_ ()-----
	}
} // CFCMolipDrawSrvrItem::Serialize.

BOOL CFCMolipDrawSrvrItem::OnGetExtent (DVASPECT dwDrawAspect, CSize& rSize)
{
	// _xZkqqHx_jBlNiCkNiCmMiDeBiDhGiDiKiDfAiBfLiDfGiDiHiDjDiCmFiCmNiBeBiDeBiDeDiDgFiDiAiCmMiDfCiDjDiDgFiDjDiDgD_xHqqkZx_ _xZkqqHx_iDeBiDfIiDhJiDeOiDgHiCmMjFgAiJoGiClOiCkPiCpAiDgOiDjDiDgIiDiLiClFiCnMiClHiBeC_xHqqkZx_
	//  OnDrawEx _xZkqqHx_iCkKiDeJiBfLiDgPiBfLiDiJiDeDiDgIiClFiCmEiCkCiCoJ_xHqqkZx_ DVASPECT_THUMBNAIL _xZkqqHx_iCmFjBlMiCmMiDeBiDfIiDhJiDeOiDgHiCoAiDfEiDhMiBfLiDgHiClHiCoJ_xHqqkZx_
	// _xZkqqHx_iOjOiCmJiCmNiBeB_xHqqkZx_OnGetExtent _xZkqqHx_iCpAjCmHiJmBiClHiCoJiDeBiDfIiDhJiDeOiDgHiCoAiDgOiDjDiDgIiDiLiClHiCoJiCoGiCkEiCmJjFmPiNfIiClFiCmEiCkNiClOiClDiCkCiBeC_xHqqkZx_

	if (dwDrawAspect != DVASPECT_CONTENT)
		return COleServerItem::OnGetExtent(dwDrawAspect, rSize);

	// CFCMolipDrawSrvrItem::OnGetExtent _xZkqqHx_iCmNiDeBiDeDiDgFiDiAjBfDjBmMiCmM_xHqqkZx_ HIMETRIC _xZkqqHx_jCfAiImKiCmMjEmNiImNiCpAjDlOiCoJ_xHqqkZx_
	// _xZkqqHx_iClNiCnPiCmJ_xHqqkZx_ _xZkqqHx_iMmEiCmOiCoKiCnMiClHiBeCiDgGiDhEiDeIiDiLiDgHiCmNiBeBjCfAiPiDiCmJiDgOiBfLiDgIiDfCiBfLiDgGiDeCiDjDiDePiClDiCoKiClNjCgMiCpAjFnEiClFiCnMiClHiBeC_xHqqkZx_

	if (g_pView == NULL) return FALSE;
	CClientDC dc(NULL);
//----- 01.05.16 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
//	// _xZkqqHx_iJpAjBjMjDhIiCpAjAnNjCoIiBeC_xHqqkZx_
//	const short nResolution = 8;
//----- 01.05.16 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----
	ObjDynabaseVector vObj;
	DBLRect mmrtFrame;
	// rSize_xZkqqHx_iCmN_xHqqkZx_ HIMETRIC _xZkqqHx_jCfAiImKiCmFjFnEiClDiCmIiCkPiCoKiCmOiCmIiCoHiCmIiCkCiClBiCmGiCpAiNgMjHlGiClFiCmEiBeB_xHqqkZx_
	// _xZkqqHx_jFjEjFgJiNmFjBoFiNmAjFfHjCgMiCpAiLhEiOfKiClHiCoJiBeC_xHqqkZx_
	CSize rSizeMax(32700, 32700);
//----- 01.04.19 Fukushiro M. _xZkqqHx_jFmPiNfIjBeP_xHqqkZx_ ()-----
//	dc.HIMETRICtoLP(&rSizeMax);
//	// _xZkqqHx_jBfDiCmEiCmMiChJiDeJiBfLiDfPiBfLiCpAiOoGjDlOiBeC_xHqqkZx_
//	FCZOrder zOrder;
//	g_pDoc->GetZOrder(zOrder, FDOZ_ON_ANY);
//	// _xZkqqHx_iDhJiBfLiDfIiDgHiJmCjEfMiCmIjFjEjFgJiCmGiBeBiKePjAnKiDhEiDiMiBfLiDiAiCpAiMhGiOfKiBeC_xHqqkZx_
//	(void)GetPasteObjFrame(vObj, mmrtFrame, &zOrder, nResolution,
//							rSizeMax.cx * nResolution, rSizeMax.cy * nResolution);
//----- 01.04.19 Fukushiro M. _xZkqqHx_jFmPiNfIiMoD_xHqqkZx_ ()-----
	// _xZkqqHx_jBfDiCmEiCmMiChJiDeJiBfLiDfPiBfLiCpAiOoGjDlOiBeC_xHqqkZx_
	FCZOrder zOrder;
	g_pDoc->GetZOrder(zOrder, FDOZ_ON_ANY);
	// _xZkqqHx_iDhJiBfLiDfIiDgHiJmCjEfMiCmIjFjEjFgJiCmGiBeBiKePjAnKiDhEiDiMiBfLiDiAiCpAiMhGiOfKiBeC_xHqqkZx_
	(void)GetPasteObjFrame(vObj, mmrtFrame, &zOrder, rSizeMax.cx, rSizeMax.cy);
//----- 01.04.19 Fukushiro M. _xZkqqHx_jFmPiNfIiPeJ_xHqqkZx_ ()-----
	// _xZkqqHx_jFjEjFgJiCkKiLpDiCmFiCoAiDfEiDeDiDfJiCmNjFnEiClHiBeC_xHqqkZx_
	if (vObj.empty())
	{
		// _xZkqqHx_jDeLjDjGiCmJiBeB_xHqqkZx_100x100_xZkqqHx_iCpAjAnNjCoIiBeC_xHqqkZx_
		rSize = CSize(100, 100);
		// rSize_xZkqqHx_iCmN_xHqqkZx_ HIMETRIC _xZkqqHx_jCfAiImKiCmFjFnEiClDiCmIiCkPiCoKiCmOiCmIiCoHiCmIiCkCiClNiCnPiBeBjFmPiKlHiBeC_xHqqkZx_
		dc.LPtoHIMETRIC(&rSize);
		 return TRUE;
	}
	// TODO: _xZkqqHx_iDhNiDgCiDhDiDjDiDeP_xHqqkZx_ _xZkqqHx_iDiCiBfLiDgIiCmGjEmNiImNiCmMjAnNjCoIiBeC_xHqqkZx_
	dc.SetMapMode(MM_ANISOTROPIC);
	//------ _xZkqqHx_jCmKiPoNiCmM_xHqqkZx_DisplayPPM(_xZkqqHx_jBkGiClP_xHqqkZx_1_xZkqqHx_jEhL_xHqqkZx_)_xZkqqHx_iCmFiMhGiOfKiClHiCoJiClNiCnPiBeBiDfJiBfLiDiAiCpAjAnNjCoI_xHqqkZx_ -----
	const double dZoomBackup = g_->dZoom;
	g_->dZoom = g_->dDisplayPPM;
	//------ rSize_xZkqqHx_iCmJjCmKiPoNiCmM_xHqqkZx_DisplayPPM(_xZkqqHx_jBkGiClP_xHqqkZx_1_xZkqqHx_jEhL_xHqqkZx_)_xZkqqHx_iCmFiMhGiOfKiClFiClNjAhNiMgAiDfEiDeDiDfJiCpAjAnNjCoI_xHqqkZx_ -----
	rSize.cx = mm2lg(mmrtFrame.Width());
	rSize.cy = mm2lg(mmrtFrame.Height());
	//------ _xZkqqHx_iClBiCoKiImIiNhOiCmN_xHqqkZx_FD_COPY_RESOLUTION_xZkqqHx_jEhLiCmMjAlIjDhIiCmF_xHqqkZx_ -----
// 05.08.19 Fukushiro M. 1_xZkqqHx_iNhDjFmPiNfI_xHqqkZx_ ()
//	g_->dZoom = g_->dDisplayPPM * g_pReg->GetCopyResolution();
	g_->dZoom = g_->dDisplayPPM * double(FD_COPY_RESOLUTION);
	CSize lgSize10(mm2lg(mmrtFrame.Width()), mm2lg(mmrtFrame.Height()));
	if (lgSize10.cx <= 0) lgSize10.cx = 1;
	if (lgSize10.cy <= 0) lgSize10.cy = 1;
	//----- _xZkqqHx_jFgAiJoGiDeJiDhEiDfKiDgCiDgHjCgMiCpAjAnNjCoI_xHqqkZx_ -----
	dc.SetWindowOrg(0, 0);
	dc.SetWindowExt(lgSize10);
	dc.SetViewportOrg(0, 0);
	dc.SetViewportExt(lgSize10);
	// rSize_xZkqqHx_iCmN_xHqqkZx_ HIMETRIC _xZkqqHx_jCfAiImKiCmFjFnEiClDiCmIiCkPiCoKiCmOiCmIiCoHiCmIiCkCiClNiCnPiBeBjFmPiKlHiBeC_xHqqkZx_
	dc.LPtoHIMETRIC(&rSize);
	// _xZkqqHx_iDfJiBfLiDiAiCpAiMlDiCmJjGnPiClHiBeC_xHqqkZx_
	g_->dZoom = dZoomBackup;
	return TRUE;
} // CFCMolipDrawSrvrItem::OnGetExtent.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCMolipDrawSrvrItem::OnDraw
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iCgOiCgLiCgEiDfEiBfLiDgPiLeAjEfMiCmMjFgAiJoGiKnGjAjEiBeCiCgOiCgLiCgEiDgGiBfLiDfOiCmJjDfJjFhEiClHiCoJiDiBiDfOiDhEiDeAiDeDiDiL_xHqqkZx_
 *			_xZkqqHx_iCmMjFgAiJoGiCpAiNhDiCkEiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	pDC		:_xZkqqHx_jFgAiJoGjHhAiDgGiDgPiDeDiDfIiDfCiDjDiDgFiDeMiDfIiDgHiBeC_xHqqkZx_
 *			rSize	:_xZkqqHx_iDiBiDfOiDhEiDeAiDeDiDiLiCmMiDfEiDeDiDfJiCpAjFnEiClHiBeC_xHqqkZx_HIMETRIC_xZkqqHx_jCfAiImKiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_jAlDiPoNiPeJjHlJiClFiClNiPoKiNiHiCmN_xHqqkZx_ 0 _xZkqqHx_iImIiKePiCpAjFnEiClFiCnMiClHiBeCiClLiCoKiImIiKePiCmMiPoKiNiHiCmN_xHqqkZx_ 0 _xZkqqHx_iCpAjFnEiClFiCnMiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jCiNiInD_xHqqkZx_>	_xZkqqHx_jDfJjFhEiClDiCoKiClNiDiBiDfOiDhEiDeAiDeDiDiLiCmNiBeBiDhJiBfLiDfIiDgHjBkEiDeBiDhGiDiKiCmFiCmMjFfMiOkGiBeFiIpDiNpMiCmJ_xHqqkZx_
 *			_xZkqqHx_iOgHiCoNiCoKiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	99.04.30 Fukushiro M. _xZkqqHx_iDfCiDiBiDjDiDgHiNoMjAkM_xHqqkZx_
 *************************************************************************/
BOOL CFCMolipDrawSrvrItem::OnDraw (CDC* pDC, CSize& rSize)
{
	return OnDrawWMF(pDC, rSize);
} // CFCMolipDrawSrvrItem::OnDraw.

/////////////////////////////////////////////////////////////////////////////
// CFCMolipDrawSrvrItem _xZkqqHx_iDeOiDiJiDfIiCmMjAgGjCgG_xHqqkZx_

#ifdef _DEBUG
void CFCMolipDrawSrvrItem::AssertValid() const
{
	COleServerItem::AssertValid();
} // CFCMolipDrawSrvrItem::AssertValid.

void CFCMolipDrawSrvrItem::Dump(CDumpContext& dc) const
{
	COleServerItem::Dump(dc);
} // CFCMolipDrawSrvrItem::Dump.
#endif

/////////////////////////////////////////////////////////////////////////////
// OnGetClipboardData is used by CopyToClipboard and DoDragDrop

//----- 03.07.13 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
//HANDLE CopyHandle (HANDLE h, UINT nFlags)
//{
//	DWORD dwLen = GlobalSize(h);
//	HANDLE hCopy = GlobalAlloc(nFlags, dwLen);
//	if (hCopy != NULL)
//	{
//		BYTE* lpCopy = (BYTE *)GlobalLock(hCopy);
//		BYTE* lp     = (BYTE *)GlobalLock(h);
//		while (dwLen--) *lpCopy++ = *lp++;
//		GlobalUnlock(hCopy);
//		GlobalUnlock(h);
//	}
//	return hCopy;
//} // CopyHandle.
//----- 03.07.13 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----

COleDataSource* CFCMolipDrawSrvrItem::OnGetClipboardData (BOOL bIncludeLink,
														LPPOINT pptOffset, LPSIZE pSize)
{
	ASSERT_VALID(this);
	COleDataSource* pDataSource = new COleDataSource;
	TRY
	{
		GetNativeClipboardData(pDataSource);
		GetClipboardData(pDataSource, bIncludeLink, pptOffset, pSize);
	}
	CATCH_ALL(e)
	{
		delete pDataSource;
		THROW_LAST();
	}
	END_CATCH_ALL

	ASSERT_VALID(pDataSource);
	return pDataSource;
} // CFCMolipDrawSrvrItem::OnGetClipboardData.

//----- 02.12.05 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
//// Molip Draw_xZkqqHx_iCmMiDeOiDiKiDgCiDhGiDhLiBfLiDgIiDfCiDhDiBfLjHhA_xHqqkZx_ Native File Data _xZkqqHx_iCmMiMgAiOkOjGlMiBeC_xHqqkZx_FoundDoc.cpp_xZkqqHx_iCmFjCoIiLgAiBeC_xHqqkZx_
//extern CLIPFORMAT g_cfDDFile;
//----- 02.12.05 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCMolipDrawSrvrItem::GetNativeClipboardData
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDgMiDeDiDgFiDeCiDhFiDgGiBfLiDfOiCpAiDeOiDiKiDgCiDhGiDhLiBfLiDgIiCmJiDfCiDhDiBfLiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iKgHjCkDiDiBiDfOiDhEiDeAiDeDiDiLiCpAiDeOiDiKiDgCiDhGiDhLiBfLiDgIiCmJiDfCiDhDiBfLiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	00.03.30 Fukushiro M. _xZkqqHx_iDfCiDiBiDjDiDgHiNoMjAkM_xHqqkZx_
 *************************************************************************/
void CFCMolipDrawSrvrItem::GetNativeClipboardData (COleDataSource *pDataSource)
{
	ASSERT_VALID(this);
	ASSERT(g_cfDDFile != NULL);

	// Create a shared file and associate a FCUndoArchive with it
	CSharedFile file;
// 05.06.03 Fukushiro M. 1_xZkqqHx_iNhDiNoNiPjM_xHqqkZx_ ()
//	FCUndoArchive ar(&file, FD_ARCHIVE_STORE, g_pDoc);
//	ar.SetDocument(g_pDoc);
	// Serialize selected objects to the archive
	g_pDoc->OutCurrentFcoreFormat(file, FD_DTP_PORTABLE_FORMAT, TRUE, TRUE);
//----- 05.06.03 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
//	// Archive_xZkqqHx_iCpAjFmCiClGiCoJiBeC_xHqqkZx_
//	ar.Close();
//----- 05.06.03 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----
	// put on local format instead of or in addation to
	pDataSource->CacheGlobalData(g_cfDDFile, file.Detach());
} // CFCMolipDrawSrvrItem::GetNativeClipboardData.

