// 34.cpp : DLL _xZkqqHx_jHhAiCmMiPiJiKpKiJlLiPiIjHjNiCmMjCoIiLgAiCpAiNhDiCkCiCnMiClHiBeC_xHqqkZx_
//

#include "stdafx.h"
#include "resource.h"		// For IDR_MAINFRAME.
#include "3HeaderInf.h"		// For MC3HeaderInf.
#include "3Document.h"		// For MC3Document.

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

// 06.05.11 Fukushiro M. 1_xZkqqHx_iNhDiNoNiPjM_xHqqkZx_ ()
//IMpgMolipMain*	g_pMolipMainI = NULL;

#define INIT_DOCUMENT \
g_pDoc = (MC3Document*)RUNTIME_CLASS(MC3Document)->CreateObject(); \
CSingleDocTemplate docTemplate(IDR_MAINFRAME, RUNTIME_CLASS(MC3Document), RUNTIME_CLASS(CFrameWnd), RUNTIME_CLASS(CView)); \
docTemplate.AddDocument(g_pDoc); \
COleTemplateServer server; \
static const CLSID clsid = DYNAMIC_DRAW_CLSID; \
server.ConnectTemplate(clsid, &docTemplate, TRUE); \
g_pDoc->OnNewDocument(); \


#define DELETE_DOCUMENT \
g_pDoc->DeleteContents(); \
delete g_pDoc; \
g_pDoc = NULL; \


//----- 06.05.12 Fukushiro M. _xZkqqHx_jCmHiJmBiOgO_xHqqkZx_ ()-----
// _xZkqqHx_iDeBiDhGiDiKiDfAiBfLiDfGiDiHiDjDiDeJiDhFiDfHiDeGiDeOiDgHiBeC_xHqqkZx_
// OLE_xZkqqHx_jFlGiPjBjDjJiCmMjDmHiCnNiPjBiCkLiCmJjFeLjAhLiBeC_xHqqkZx_
CWinApp theApp;
//----- 06.05.12 Fukushiro M. _xZkqqHx_jCmHiJmBiPeJ_xHqqkZx_ ()-----

//----- 06.03.31 Fukushiro M. _xZkqqHx_jFmPiNfIjBeP_xHqqkZx_ ()-----
///*************************************************************************
// * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	ConvertCcoreToFcore
// *
// * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_jFkBiNiHiDfCiDeBiCfC_xHqqkZx_ -> _xZkqqHx_iDhEiDiJiDgCiDgHiDfCiDeBiCfC_xHqqkZx_ _xZkqqHx_iCmMjFmPiKlHiCpAiNhDiCkEiBeC_xHqqkZx_
// *
// * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	pIMain	:DynamicDraw_xZkqqHx_iCmMiDiBiDeDiDjDiDeDiDjDiDfOiDhEiDeGiBfLiDfIiCpAiOhHjCoIiBeC_xHqqkZx_
// *			arFrom	:_xZkqqHx_jDmHiCnNiPgPiClFiMlDiCmMiDeBiBfLiDeKiDeDiDhFiCpAiOhHjCoIiBeC_xHqqkZx_
// *			fileTo	:_xZkqqHx_iPjBiCkLiNjOiCnNjAoGiCmMiDeBiBfLiDeKiDeDiDhFiCpAiOhHjCoIiBeC_xHqqkZx_
// *			formTo	:_xZkqqHx_iPjBiCkLiNjOiCnNiCmMiDhHiDgCiDfPiCmJiLeMiPhBiClDiCoKiCoJjFlGiPjBiMfOiCpAiOhHjCoIiBeC_xHqqkZx_FD_DTP_NONE _xZkqqHx_iCkK_xHqqkZx_
// *					 _xZkqqHx_iOhHjCoIiClDiCoKiClNiPoKiNiHiCmNjDmHiCnNiPgPiClFiMlDiCmMjFlGiPjBiMfOiCmJiPiHiClIiCoJiBeC_xHqqkZx_
// *			pStorage:_xZkqqHx_jDmHiCnNiPgPiClFiMlDiCmMiDfIiDgHiDiMiBfLiDfHiCpAiOhHjCoIiBeC_xHqqkZx_
// *
// * <_xZkqqHx_iJpAjAoA_xHqqkZx_>	_xZkqqHx_jDmHiCnNiPgPiClFiMlDiCkKjFkBiNiHiDhEiDeAiDeDiDiLiCmIiCmMiCmFiBeB_xHqqkZx_CArchive_xZkqqHx_iBgJ_xHqqkZx_CArchive_xZkqqHx_iCmJiKnMiCnMiCoKiCoJiBgKiCmG_xHqqkZx_
// *			STORAGE_xZkqqHx_iCmMjBgHiCnNiNiHiCoNiClJiCpAiOhHjCoIiClFiCmEiCkCiCoJiBeC_xHqqkZx_
// *
// * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.06.01 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
// *************************************************************************/
//extern "C" void APIENTRY ConvertCcoreToFcore (	IMpgMolipMain* pIMain,
//												CArchive* arFrom,
//												MfcFile* fileTo,
//												FTDocumentFormat formTo,
//												LPSTORAGE pStorage)
//{
////	AfxDebugBreak();
//	g_pMolipMainI = pIMain;
//
//	// _xZkqqHx_iDiKiDfMiBfLiDfIiCpAiClBiCmM_xHqqkZx_DLL_xZkqqHx_iCmJjAnNjCoIiBeC_xHqqkZx_
//	AfxSetResourceHandle(GetModuleHandle(NULL));
//
//	// g_pDoc_xZkqqHx_iCmMiPiJiKpKiJlLiBeC_xHqqkZx_
//	INIT_DOCUMENT
//
//	// _xZkqqHx_iDgIiDeMiDiFiDiBiDjDiDgHiCmMiDfIiDgHiDiMiBfLiDfHiCpAiBeBjFkBiNiHiDfCiDeBiCmMiDhEiDeAiDeDiDiLiCpAiKeKiCkCiCmEiCkCiCoJ_xHqqkZx_
//	// _xZkqqHx_iDfIiDgHiDiMiBfLiDfHiCmGjChFiCkLiKlHiCkGiCoJiBeC_xHqqkZx_
//	LPSTORAGE pStorageOld = g_pDoc->SetRootStorage(pStorage);
//
//	// _xZkqqHx_iDeBiBfLiDeKiDeDiDhFiCmJjAnNjCoIiClDiCoKiCmEiCkCiCoJiDgIiDeMiDiFiDiBiDjDiDgHiDeJiDhFiDfHiDeGiDeOiDgHiCpAjChFiCkLiKlHiCkGiCoJiBeC_xHqqkZx_
//	CDocument* pDocFrom = arFrom->GetDocument();
//	arFrom->SetDocument(g_pDoc);
//	// _xZkqqHx_iDfIiDgHiDiKiBfLiDiAiCpAjDmHiCnNiPgPiClHiBeC_xHqqkZx_
//	g_pDoc->InStreamCore(*arFrom, FALSE);
//	// _xZkqqHx_iDeBiBfLiDeKiDeDiDhFiCmMiDgIiDeMiDiFiDiBiDjDiDgHiDeJiDhFiDfHiDeGiDeOiDgHiCpAiMlDiCmJjGnPiClHiBeC_xHqqkZx_
//	arFrom->SetDocument(pDocFrom);
//
//	// _xZkqqHx_iDgIiDeMiDiFiDiBiDjDiDgHiCmMiDfIiDgHiDiMiBfLiDfHiCpAjGlDiMpIiCmIjCgMiCmJjChFiCkLiKlHiCkGiCoJiBeC_xHqqkZx_
//	// _xZkqqHx_jFhDjHhGiCmIiPiIjHjNiClOiCkKiBeBiDfIiDgHiDiMiBfLiDfHiCkKiDhEiDeAiDeDiDiLiPjBiCkLiNjOiCnNiCmJjHjIjHhAiClDiCoKiCmIiCkCiClBiCmGiCpA_xHqqkZx_
//	// _xZkqqHx_iKgNjEeGiClHiCoJiClNiCnPiCmJiOmAiOhLiBeC_xHqqkZx_
//	g_pDoc->SetRootStorage(LPSTORAGE(-1));
//
//	// _xZkqqHx_iDhEiDeAiDeDiDiLiMfOiCpAiOhHjCoIiBeC_xHqqkZx_
//	if (formTo != FD_DTP_NONE) g_pDoc->SetFileType(formTo);
//	// _xZkqqHx_iDeBiBfLiDeKiDeDiDhFiCpAiNoMjAkMiBeC_xHqqkZx_
//	CArchive* arTo = FFClassCreate((CArchive*)NULL);
//	arTo->Initialize(fileTo, FD_ARCHIVE_STORE, g_pDoc);
//	// _xZkqqHx_iDfIiDgHiDiKiBfLiDiAiCpAiPjBiCkLiNjOiCnOiBeC_xHqqkZx_
//	g_pDoc->OutStreamCore(*arTo, TRUE);
//	// _xZkqqHx_iDeBiBfLiDeKiDeDiDhFiCmMiDgGiBfLiDfOiCpA_xHqqkZx_fileTo_xZkqqHx_iCmJiPjBiCkLiNjOiCnOiBeC_xHqqkZx_
//	arTo->Flush();
//	// _xZkqqHx_iDeBiBfLiDeKiDeDiDhFiCpAiNoNiPjMiBeC_xHqqkZx_
//	FFClassDelete(arTo);
//	// _xZkqqHx_iDgIiDeMiDiFiDiBiDjDiDgHiCmMiDfIiDgHiDiMiBfLiDfHiCpAiMlDiCmJjGnPiClHiBeC_xHqqkZx_
//	g_pDoc->SetRootStorage(pStorageOld);
//
//	// g_pDoc_xZkqqHx_iCmMiNoNiPjMiBeC_xHqqkZx_
//	DELETE_DOCUMENT
//
//	g_pMolipMainI = NULL;
//} // ConvertCcoreToFcore.
//----- 06.03.31 Fukushiro M. _xZkqqHx_jFmPiNfIiMoD_xHqqkZx_ ()-----
/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	ConvertCcoreToFcore
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_jFkBiNiHiDfCiDeBiCfC_xHqqkZx_ -> _xZkqqHx_iDhEiDiJiDgCiDgHiDfCiDeBiCfC_xHqqkZx_ _xZkqqHx_iCmMjFmPiKlHiCpAiNhDiCkEiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	pIMain		:DynamicDraw_xZkqqHx_iCmMiDiBiDeDiDjDiDeDiDjDiDfOiDhEiDeGiBfLiDfIiCpAiOhHjCoIiBeC_xHqqkZx_
 *			pStorageFrom:_xZkqqHx_jDmHiCnNiPgPiClFiMlDiCmMiDfIiDgHiDiMiBfLiDfHiCpAiOhHjCoIiBeC_xHqqkZx_
 *			fileTo		:_xZkqqHx_iPjBiCkLiNjOiCnNjAoGiCmMiDeBiBfLiDeKiDeDiDhFiCpAiOhHjCoIiBeC_xHqqkZx_
 *			formTo		:_xZkqqHx_iPjBiCkLiNjOiCnNiCmMiDhHiDgCiDfPiCmJiLeMiPhBiClDiCoKiCoJjFlGiPjBiMfOiCpAiOhHjCoIiBeC_xHqqkZx_FD_DTP_NONE _xZkqqHx_iCkK_xHqqkZx_
 *						 _xZkqqHx_iOhHjCoIiClDiCoKiClNiPoKiNiHiCmNjDmHiCnNiPgPiClFiMlDiCmMjFlGiPjBiMfOiCmJiPiHiClIiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	06.03.31 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
// 06.05.11 Fukushiro M. 1_xZkqqHx_iNhDjFmPiNfI_xHqqkZx_ ()
//extern "C" void APIENTRY ConvertCcoreToFcore (	IMpgMolipMain* pIMain,
extern "C" void APIENTRY ConvertCcoreToFcore (	
												LPSTORAGE pStorageFrom,
												MfcFile* fileTo,
												FTDocumentFormat formTo)
{
// 06.05.11 Fukushiro M. 1_xZkqqHx_iNhDiNoNiPjM_xHqqkZx_ ()
//	g_pMolipMainI = pIMain;

	// _xZkqqHx_iDiKiDfMiBfLiDfIiCpAiClBiCmM_xHqqkZx_DLL_xZkqqHx_iCmJjAnNjCoIiBeC_xHqqkZx_
// 06.05.06 Fukushiro M. 1_xZkqqHx_iNhDjFmPiNfI_xHqqkZx_ ()
//	AfxSetResourceHandle(GetModuleHandle(NULL));
	FCResourceHandleBackup rcBack(GetModuleHandle(NULL));

	// g_pDoc_xZkqqHx_iCmMiPiJiKpKiJlLiBeC_xHqqkZx_
	INIT_DOCUMENT


// _xZkqqHx_iDgFiDfIiDgHiBeC_xHqqkZx_
	FFUtilErrI->ReleaseTraceMessage(L"ToCore3 ConvertCcoreToFcore 1\r\n");

	// _xZkqqHx_iDgIiDeMiDiFiDiBiDjDiDgHiCmMiDfIiDgHiDiMiBfLiDfHiCpAiBeBjFkBiNiHiDfCiDeBiCmMiDhEiDeAiDeDiDiLiCpAiKeKiCkCiCmEiCkCiCoJ_xHqqkZx_
	// _xZkqqHx_iDfIiDgHiDiMiBfLiDfHiCmGjChFiCkLiKlHiCkGiCoJiBeC_xHqqkZx_
	LPSTORAGE pStorageOld = g_pDoc->SetRootStorage(pStorageFrom);
	// _xZkqqHx_iDfIiDgHiDiKiBfLiDiAiCpAjDmHiCnNiPgPiClHiBeC_xHqqkZx_
	g_pDoc->OnOpenDocument(NULL);

// _xZkqqHx_iDgFiDfIiDgHiBeC_xHqqkZx_
	FFUtilErrI->ReleaseTraceMessage(L"ToCore3 ConvertCcoreToFcore 3\r\n");

	// _xZkqqHx_iDgIiDeMiDiFiDiBiDjDiDgHiCmMiDfIiDgHiDiMiBfLiDfHiCpAjGlDiMpIiCmIjCgMiCmJjChFiCkLiKlHiCkGiCoJiBeC_xHqqkZx_
	// _xZkqqHx_jFhDjHhGiCmIiPiIjHjNiClOiCkKiBeBiDfIiDgHiDiMiBfLiDfHiCkKiDhEiDeAiDeDiDiLiPjBiCkLiNjOiCnNiCmJjHjIjHhAiClDiCoKiCmIiCkCiClBiCmGiCpA_xHqqkZx_
	// _xZkqqHx_iKgNjEeGiClHiCoJiClNiCnPiCmJiOmAiOhLiBeC_xHqqkZx_
	g_pDoc->SetRootStorage(LPSTORAGE(-1));

	// _xZkqqHx_iDhEiDeAiDeDiDiLiMfOiCpAiOhHjCoIiBeC_xHqqkZx_
	if (formTo != FD_DTP_NONE) g_pDoc->SetFileType(formTo);
//----- 06.05.11 Fukushiro M. _xZkqqHx_jFmPiNfIjBeP_xHqqkZx_ ()-----
//	// _xZkqqHx_iDeBiBfLiDeKiDeDiDhFiCpAiNoMjAkMiBeC_xHqqkZx_
//	CArchive* arTo = FFClassCreate((CArchive*)NULL);
//	arTo->Initialize(fileTo, FD_ARCHIVE_STORE, g_pDoc);
//	// _xZkqqHx_iDfIiDgHiDiKiBfLiDiAiCpAiPjBiCkLiNjOiCnOiBeC_xHqqkZx_
//	g_pDoc->OutStreamCore(*arTo, TRUE);
//	// _xZkqqHx_iDeBiBfLiDeKiDeDiDhFiCmMiDgGiBfLiDfOiCpA_xHqqkZx_fileTo_xZkqqHx_iCmJiPjBiCkLiNjOiCnOiBeC_xHqqkZx_
//	arTo->Flush();
//	// _xZkqqHx_iDeBiBfLiDeKiDeDiDhFiCpAiNoNiPjMiBeC_xHqqkZx_
//	FFClassDelete(arTo);
//----- 06.05.11 Fukushiro M. _xZkqqHx_jFmPiNfIiMoD_xHqqkZx_ ()-----
	// _xZkqqHx_iDeBiBfLiDeKiDeDiDhFiCpAiNoMjAkMiBeC_xHqqkZx_
	CFCMfcFile fileTo2(fileTo);

//----- 06.05.13 Fukushiro M. _xZkqqHx_jCmHiJmBiOgO_xHqqkZx_ ()-----
// _xZkqqHx_iDgFiDfIiDgHiBeC_xHqqkZx_
	FFUtilErrI->ReleaseTraceMessage(L"ToCore3 ConvertCcoreToFcore 4\r\n");
//----- 06.05.13 Fukushiro M. _xZkqqHx_jCmHiJmBiPeJ_xHqqkZx_ ()-----

	CArchive arTo(&fileTo2, CArchive::store);
	arTo.m_pDocument = g_pDoc;

// _xZkqqHx_iDgFiDfIiDgHiBeC_xHqqkZx_
	FFUtilErrI->ReleaseTraceMessage(L"ToCore3 ConvertCcoreToFcore 5\r\n");

	// _xZkqqHx_iDfIiDgHiDiKiBfLiDiAiCpAiPjBiCkLiNjOiCnOiBeC_xHqqkZx_
	g_pDoc->OutStreamCore(arTo, TRUE);


// _xZkqqHx_iDgFiDfIiDgHiBeC_xHqqkZx_
	FFUtilErrI->ReleaseTraceMessage(L"ToCore3 ConvertCcoreToFcore 8\r\n");

	// _xZkqqHx_iDeBiBfLiDeKiDeDiDhFiCmMiDgGiBfLiDfOiCpA_xHqqkZx_fileTo_xZkqqHx_iCmJiPjBiCkLiNjOiCnOiBeC_xHqqkZx_
	arTo.Flush();
//----- 06.05.11 Fukushiro M. _xZkqqHx_jFmPiNfIiPeJ_xHqqkZx_ ()-----
	// _xZkqqHx_iDgIiDeMiDiFiDiBiDjDiDgHiCmMiDfIiDgHiDiMiBfLiDfHiCpAiMlDiCmJjGnPiClHiBeC_xHqqkZx_
	g_pDoc->SetRootStorage(pStorageOld);

// _xZkqqHx_iDgFiDfIiDgHiBeC_xHqqkZx_
	FFUtilErrI->ReleaseTraceMessage(L"ToCore3 ConvertCcoreToFcore 10\r\n");

	// g_pDoc_xZkqqHx_iCmMiNoNiPjMiBeC_xHqqkZx_
	DELETE_DOCUMENT

// 06.05.11 Fukushiro M. 1_xZkqqHx_iNhDiNoNiPjM_xHqqkZx_ ()
//	g_pMolipMainI = NULL;
} // ConvertCcoreToFcore.
//----- 06.03.31 Fukushiro M. _xZkqqHx_jFmPiNfIiPeJ_xHqqkZx_ ()-----

//----- 06.03.31 Fukushiro M. _xZkqqHx_jFmPiNfIjBeP_xHqqkZx_ ()-----
///*************************************************************************
// * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	ConvertFcoreToCcore
// *
// * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDhEiDiJiDgCiDgHiDfCiDeBiCfC_xHqqkZx_ -> _xZkqqHx_jFkBiNiHiDfCiDeBiCfC_xHqqkZx_ _xZkqqHx_iCmMjFmPiKlHiCpAiNhDiCkEiBeC_xHqqkZx_
// *
// * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	pIMain	:DynamicDraw_xZkqqHx_iCmMiDiBiDeDiDjDiDeDiDjDiDfOiDhEiDeGiBfLiDfIiCpAiOhHjCoIiBeC_xHqqkZx_
// *			fileFrom:_xZkqqHx_jDmHiCnNiPgPiClFiMlDiCmMiDeBiBfLiDeKiDeDiDhFiCpAiOhHjCoIiBeC_xHqqkZx_
// *			arTo	:_xZkqqHx_iPjBiCkLiNjOiCnNjAoGiCmMiDeBiBfLiDeKiDeDiDhFiCpAiOhHjCoIiBeC_xHqqkZx_
// *			pStorage:_xZkqqHx_jDmHiCnNiPgPiClFiMlDiCmMiDfIiDgHiDiMiBfLiDfHiCpAiOhHjCoIiBeC_xHqqkZx_
// *
// * <_xZkqqHx_iJpAjAoA_xHqqkZx_>	_xZkqqHx_iPjBiCkLiNjOiCnNjAoGiCkKjFkBiNiHiDhEiDeAiDeDiDiLiCmIiCmMiCmFiBeB_xHqqkZx_CArchive_xZkqqHx_iBgJ_xHqqkZx_CArchive_xZkqqHx_iCmJiKnMiCnMiCoKiCoJiBgKiCmG_xHqqkZx_
// *			STORAGE_xZkqqHx_iCmMjBgHiCnNiNiHiCoNiClJiCpAiOhHjCoIiClFiCmEiCkCiCoJiBeC_xHqqkZx_
// *
// * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.06.01 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
// *************************************************************************/
//extern "C" void APIENTRY ConvertFcoreToCcore (	IMpgMolipMain* pIMain,
//												MfcFile* fileFrom,
//												CArchive* arTo,
//												LPSTORAGE pStorage)
//{
//	g_pMolipMainI = pIMain;
//
//	// _xZkqqHx_iDiKiDfMiBfLiDfIiCpAiClBiCmM_xHqqkZx_DLL_xZkqqHx_iCmJjAnNjCoIiBeC_xHqqkZx_
//	AfxSetResourceHandle(GetModuleHandle(NULL));
//
//	// g_pDoc_xZkqqHx_iCmMiPiJiKpKiJlLiBeC_xHqqkZx_
//	INIT_DOCUMENT
//
//	// _xZkqqHx_iDgIiDeMiDiFiDiBiDjDiDgHiCmMiDfIiDgHiDiMiBfLiDfHiCpAiBeBjFkBiNiHiDfCiDeBiCmMiDhEiDeAiDeDiDiLiCpAiKeKiCkCiCmEiCkCiCoJ_xHqqkZx_
//	// _xZkqqHx_iDfIiDgHiDiMiBfLiDfHiCmGjChFiCkLiKlHiCkGiCoJiBeC_xHqqkZx_
//	LPSTORAGE pStorageOld = g_pDoc->SetRootStorage(pStorage);
//
//	// _xZkqqHx_iDeBiBfLiDeKiDeDiDhFiCpAiNoMjAkMiBeC_xHqqkZx_
//	CArchive* arFrom = FFClassCreate((CArchive*)NULL);
//	arFrom->Initialize(fileFrom, FD_ARCHIVE_LOAD, g_pDoc);
//	// _xZkqqHx_iDfIiDgHiDiKiBfLiDiAiCpAjDmHiCnNiPgPiClHiBeC_xHqqkZx_
//	g_pDoc->InStreamCore(*arFrom, TRUE);
//	// _xZkqqHx_iDeBiBfLiDeKiDeDiDhFiCpAiNoNiPjMiBeC_xHqqkZx_
//	FFClassDelete(arFrom);
//
//	// _xZkqqHx_iDhEiDeAiDeDiDiLiMfOiCpAiOhHjCoIiBeC_xHqqkZx_
//	g_pDoc->SetFileType(FD_DTP_STANDARD_FORMAT);
//	// _xZkqqHx_iDeBiBfLiDeKiDeDiDhFiCmJjAnNjCoIiClDiCoKiCmEiCkCiCoJiDgIiDeMiDiFiDiBiDjDiDgHiDeJiDhFiDfHiDeGiDeOiDgHiCpAjChFiCkLiKlHiCkGiCoJiBeC_xHqqkZx_
//	CDocument* pDocTo = arTo->GetDocument();
//	arTo->SetDocument(g_pDoc);
//	// _xZkqqHx_iDfIiDgHiDiKiBfLiDiAiCpAiPjBiCkLiNjOiCnOiBeC_xHqqkZx_
//	g_pDoc->OutStreamCore(*arTo, FALSE);
//	// _xZkqqHx_iDeBiBfLiDeKiDeDiDhFiCmMiDgGiBfLiDfOiCpA_xHqqkZx_file_xZkqqHx_iCmJiPjBiCkLiNjOiCnOiBeC_xHqqkZx_
//	arTo->Flush();
//	// _xZkqqHx_iDeBiBfLiDeKiDeDiDhFiCmMiDgIiDeMiDiFiDiBiDjDiDgHiDeJiDhFiDfHiDeGiDeOiDgHiCpAiMlDiCmJjGnPiClHiBeC_xHqqkZx_
//	arTo->SetDocument(pDocTo);
//
//	// _xZkqqHx_iDgIiDeMiDiFiDiBiDjDiDgHiCmMiDfIiDgHiDiMiBfLiDfHiCpAiMlDiCmJjGnPiClHiBeC_xHqqkZx_
//	g_pDoc->SetRootStorage(pStorageOld);
//
//	// g_pDoc_xZkqqHx_iCmMiNoNiPjMiBeC_xHqqkZx_
//	DELETE_DOCUMENT
//
//	g_pMolipMainI = NULL;
//} // ConvertFcoreToCcore.
//----- 06.03.31 Fukushiro M. _xZkqqHx_jFmPiNfIiMoD_xHqqkZx_ ()-----
/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	ConvertFcoreToCcore
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDhEiDiJiDgCiDgHiDfCiDeBiCfC_xHqqkZx_ -> _xZkqqHx_jFkBiNiHiDfCiDeBiCfC_xHqqkZx_ _xZkqqHx_iCmMjFmPiKlHiCpAiNhDiCkEiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	pIMain		:DynamicDraw_xZkqqHx_iCmMiDiBiDeDiDjDiDeDiDjDiDfOiDhEiDeGiBfLiDfIiCpAiOhHjCoIiBeC_xHqqkZx_
 *			fileFrom	:_xZkqqHx_jDmHiCnNiPgPiClFiMlDiCmMiDeBiBfLiDeKiDeDiDhFiCpAiOhHjCoIiBeC_xHqqkZx_
 *			pStorageTo	:_xZkqqHx_iPjBiCkLiNjOiCnNjAoGiCmMiDfIiDgHiDiMiBfLiDfHiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	06.03.31 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
// 06.05.11 Fukushiro M. 1_xZkqqHx_iNhDjFmPiNfI_xHqqkZx_ ()
//extern "C" void APIENTRY ConvertFcoreToCcore (	IMpgMolipMain* pIMain,
extern "C" void APIENTRY ConvertFcoreToCcore (	
												MfcFile* fileFrom,
												LPSTORAGE pStorageTo)
{
// 06.05.11 Fukushiro M. 1_xZkqqHx_iNhDiNoNiPjM_xHqqkZx_ ()
//	g_pMolipMainI = pIMain;

	// _xZkqqHx_iDiKiDfMiBfLiDfIiCpAiClBiCmM_xHqqkZx_DLL_xZkqqHx_iCmJjAnNjCoIiBeC_xHqqkZx_
// 06.05.06 Fukushiro M. 1_xZkqqHx_iNhDjFmPiNfI_xHqqkZx_ ()
//	AfxSetResourceHandle(GetModuleHandle(NULL));
	FCResourceHandleBackup rcBack(GetModuleHandle(NULL));

	// g_pDoc_xZkqqHx_iCmMiPiJiKpKiJlLiBeC_xHqqkZx_
	INIT_DOCUMENT

//----- 06.05.11 Fukushiro M. _xZkqqHx_jFmPiNfIjBeP_xHqqkZx_ ()-----
//	// _xZkqqHx_iDeBiBfLiDeKiDeDiDhFiCpAiNoMjAkMiBeC_xHqqkZx_
//	CArchive* arFrom = FFClassCreate((CArchive*)NULL);
//	arFrom->Initialize(fileFrom, FD_ARCHIVE_LOAD, g_pDoc);
//	// _xZkqqHx_iDfIiDgHiDiKiBfLiDiAiCpAjDmHiCnNiPgPiClHiBeC_xHqqkZx_
//	g_pDoc->InStreamCore(*arFrom, TRUE);
//	// _xZkqqHx_iDeBiBfLiDeKiDeDiDhFiCpAiNoNiPjMiBeC_xHqqkZx_
//	FFClassDelete(arFrom);
//----- 06.05.11 Fukushiro M. _xZkqqHx_jFmPiNfIiMoD_xHqqkZx_ ()-----
	// _xZkqqHx_iDeBiBfLiDeKiDeDiDhFiCpAiNoMjAkMiBeC_xHqqkZx_
	CFCMfcFile fileFrom2(fileFrom);
	CArchive arFrom(&fileFrom2, CArchive::load);
	arFrom.m_pDocument = g_pDoc;
	// _xZkqqHx_iDfIiDgHiDiKiBfLiDiAiCpAjDmHiCnNiPgPiClHiBeC_xHqqkZx_
	g_pDoc->InStreamCore(arFrom, TRUE);
//----- 06.05.11 Fukushiro M. _xZkqqHx_jFmPiNfIiPeJ_xHqqkZx_ ()-----

	// _xZkqqHx_iDhEiDeAiDeDiDiLiMfOiCpAiOhHjCoIiBeC_xHqqkZx_
	g_pDoc->SetFileType(FD_DTP_STANDARD_FORMAT);

	// _xZkqqHx_iIoKiOjOjDeJiCmIiDhEiDeAiDeDiDiLiCmJjFnLjBlGiClHiCoJiClBiCmGiCmFiBeBjDoAjFjEiCmJiDfIiDgHiDiMiBfLiDfHiCpAiNoMjAkMiBeC_xHqqkZx_
	WString wstrTmpPath;
	FFUtilFileI->MakeUniqTmpFileName(wstrTmpPath, L"work", L".tmp");
	g_pDoc->OnSaveDocument(WStrToTStr(wstrTmpPath));
	// _xZkqqHx_iDfIiDgHiDiMiBfLiDfHiCpAiOoGjDlOiClHiCoJiBeC_xHqqkZx_
	LPSTORAGE lpStorageTmp = g_pDoc->SetRootStorage(NULL);
	// _xZkqqHx_iDfIiDgHiDiMiBfLiDfHiCpAjFkBiOmKiClHiCoJiBeC_xHqqkZx_
	if (lpStorageTmp->CopyTo(0, NULL, NULL, pStorageTo) == S_OK)
	{
		// _xZkqqHx_iDfIiDgHiDiMiBfLiDfHiCpAjFnLjBlGiBeC_xHqqkZx_
		pStorageTo->Commit(STGC_OVERWRITE);
	} else
	{
		FFUtilErrI->ThrowMiscExceptionCode(FD_IDS_ERR_FILE_DESTROIED);
	}
	// _xZkqqHx_iDgIiDeMiDiFiDiBiDjDiDgHiCmMiDfIiDgHiDiMiBfLiDfHiCpAiMlDiCmJjGnPiClHiBeC_xHqqkZx_
	g_pDoc->SetRootStorage(lpStorageTmp);
	// g_pDoc_xZkqqHx_iCmMiNoNiPjMiBeC_xHqqkZx_
	DELETE_DOCUMENT
	// _xZkqqHx_iIoKiOjOiDhEiDeAiDeDiDiLiCpAiNoNiPjMiBeC_xHqqkZx_
	FFUtilFileI->DeleteFile(wstrTmpPath.c_str());
// 06.05.11 Fukushiro M. 1_xZkqqHx_iNhDiNoNiPjM_xHqqkZx_ ()
//	g_pMolipMainI = NULL;
} // ConvertFcoreToCcore.
//----- 06.03.31 Fukushiro M. _xZkqqHx_jFmPiNfIiPeJ_xHqqkZx_ ()-----

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	ConvertFileToFcore
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDhEiDeAiDeDiDiL_xHqqkZx_ -> _xZkqqHx_iDhEiDiJiDgCiDgHiDfCiDeBiCfC_xHqqkZx_ _xZkqqHx_iCmMjFmPiKlHiCpAiNhDiCkEiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	pIMain	:DynamicDraw_xZkqqHx_iCmMiDiBiDeDiDjDiDeDiDjDiDfOiDhEiDeGiBfLiDfIiCpAiOhHjCoIiBeC_xHqqkZx_
 *			wcpFileFrom	:_xZkqqHx_jDmHiCnNiPgPiClFiMlDiCmMiDhEiDeAiDeDiDiLjGlMiCpAiOhHjCoIiBeC_xHqqkZx_
 *			fileTo	:_xZkqqHx_iPjBiCkLiNjOiCnNjAoGiCmMiDeBiBfLiDeKiDeDiDhFiCpAiOhHjCoIiBeC_xHqqkZx_
 *			formTo	:_xZkqqHx_iPjBiCkLiNjOiCnNiCmMiDhHiDgCiDfPiCmJiLeMiPhBiClDiCoKiCoJjFlGiPjBiMfOiCpAiOhHjCoIiBeC_xHqqkZx_FD_DTP_NONE _xZkqqHx_iCkK_xHqqkZx_
 *					 _xZkqqHx_iOhHjCoIiClDiCoKiClNiPoKiNiHiCmNjDmHiCnNiPgPiClFiMlDiCmMjFlGiPjBiMfOiCmJiPiHiClIiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.06.03 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
// 06.05.11 Fukushiro M. 1_xZkqqHx_iNhDjFmPiNfI_xHqqkZx_ ()
//extern "C" void APIENTRY ConvertFileToFcore (	IMpgMolipMain* pIMain,
extern "C" void APIENTRY ConvertFileToFcore (	
												const wchar_t* wcpFileFrom,
												MfcFile* fileTo,
												FTDocumentFormat formTo)
{
// 06.05.11 Fukushiro M. 1_xZkqqHx_iNhDiNoNiPjM_xHqqkZx_ ()
//	g_pMolipMainI = pIMain;

	// _xZkqqHx_iDiKiDfMiBfLiDfIiCpAiClBiCmM_xHqqkZx_DLL_xZkqqHx_iCmJjAnNjCoIiBeC_xHqqkZx_
// 06.05.06 Fukushiro M. 1_xZkqqHx_iNhDjFmPiNfI_xHqqkZx_ ()
//	AfxSetResourceHandle(GetModuleHandle(NULL));
	FCResourceHandleBackup rcBack(GetModuleHandle(NULL));

	// _xZkqqHx_iOhHjCoIiClDiCoKiClNiDhEiDeAiDeDiDiLiCmMiKgHjCkDiOhBiCpAjDlOiCoJiBeC_xHqqkZx_
	WString wstrExtension;
	FFUtilFileI->SplitFileName(NULL, &wstrExtension, wcpFileFrom);
	// _xZkqqHx_iKgHjCkDiOhBiCkJiCoHiMfOiCpAiLiBiCnPiCoJiBeC_xHqqkZx_
	FTDocumentFormat df = FD_DTP_NONE;		// _xZkqqHx_iMfOjGlDiClFiBeC_xHqqkZx_
	if (_wcsicmp(wstrExtension.c_str(), FD_FILE_EXT_STANDARD_FORMAT) == 0)
	//----- Dynamic Draw Standard Format -----
	{
		df = FD_DTP_STANDARD_FORMAT;	// _xZkqqHx_jCmKiPoNiDhEiDeIiBfLiDhNiDgCiDgHiCmMjFlGiPjBiBeC_xHqqkZx_(.mdrw)
	} else
	if (_wcsicmp(wstrExtension.c_str(), FD_FILE_EXT_TEMPLATE_FORMAT) == 0)
	//----- Dynamic Draw Template Format -----
	{
		df = FD_DTP_TEMPLATE_FORMAT;	// _xZkqqHx_iDgFiDjDiDhGiDiMiBfLiDgHiDhEiDeIiBfLiDhNiDgCiDgHiCmMjFlGiPjBiBeC_xHqqkZx_(.mdwt)
	}

	BOOL bSucceed = FALSE;
	// g_pDoc_xZkqqHx_iCmMiPiJiKpKiJlLiBeC_xHqqkZx_
	INIT_DOCUMENT

	if (df == FD_DTP_STANDARD_FORMAT)
	//----- _xZkqqHx_jCmKiPoNiDhEiDeIiBfLiDhNiDgCiDgHiCmMjFlGiPjBiBeC_xHqqkZx_(.mdrw) -----
	{
		bSucceed = g_pDoc->OnOpenDocument(WStrToTStr(wcpFileFrom));
	} else
	if (df == FD_DTP_TEMPLATE_FORMAT)
	//----- _xZkqqHx_iDgFiDjDiDhGiDiMiBfLiDgHiDhEiDeIiBfLiDhNiDgCiDgHiCmMjFlGiPjBiBeC_xHqqkZx_(.mdwt) -----
	{
		bSucceed = g_pDoc->LoadTemplate(wcpFileFrom);
	}
	if (bSucceed)
	//----- _xZkqqHx_jDmHiCnNiNjOiCnNiCmJjAkMiMpHiClFiClNiPoKiNiH_xHqqkZx_ -----
	{
		// _xZkqqHx_iDhEiDeAiDeDiDiLiMfOiCpAiOhHjCoIiBeC_xHqqkZx_
		if (formTo != FD_DTP_NONE) g_pDoc->SetFileType(formTo);
//----- 06.05.11 Fukushiro M. _xZkqqHx_jFmPiNfIjBeP_xHqqkZx_ ()-----
//		// _xZkqqHx_iDeBiBfLiDeKiDeDiDhFiCpAiNoMjAkMiBeC_xHqqkZx_
//		CArchive* arTo = FFClassCreate((CArchive*)NULL);
//		arTo->Initialize(fileTo, FD_ARCHIVE_STORE, g_pDoc);
//		// _xZkqqHx_iDfIiDgHiDiKiBfLiDiAiCpAiPjBiCkLiNjOiCnOiBeC_xHqqkZx_
//		g_pDoc->OutStreamCore(*arTo, TRUE);
//		// _xZkqqHx_iDeBiBfLiDeKiDeDiDhFiCmMiDgGiBfLiDfOiCpA_xHqqkZx_fileTo_xZkqqHx_iCmJiPjBiCkLiNjOiCnOiBeC_xHqqkZx_
//		arTo->Flush();
//		// _xZkqqHx_iDeBiBfLiDeKiDeDiDhFiCpAiNoNiPjMiBeC_xHqqkZx_
//		FFClassDelete(arTo);
//----- 06.05.11 Fukushiro M. _xZkqqHx_jFmPiNfIiMoD_xHqqkZx_ ()-----
		// _xZkqqHx_iDeBiBfLiDeKiDeDiDhFiCpAiNoMjAkMiBeC_xHqqkZx_
		CFCMfcFile fileTo2(fileTo);
		CArchive arTo(&fileTo2, CArchive::store);
		arTo.m_pDocument = g_pDoc;
		// _xZkqqHx_iDfIiDgHiDiKiBfLiDiAiCpAiPjBiCkLiNjOiCnOiBeC_xHqqkZx_
		g_pDoc->OutStreamCore(arTo, TRUE);
		// _xZkqqHx_iDeBiBfLiDeKiDeDiDhFiCmMiDgGiBfLiDfOiCpA_xHqqkZx_fileTo_xZkqqHx_iCmJiPjBiCkLiNjOiCnOiBeC_xHqqkZx_
		arTo.Flush();
//----- 06.05.11 Fukushiro M. _xZkqqHx_jFmPiNfIiPeJ_xHqqkZx_ ()-----
	}
	// g_pDoc_xZkqqHx_iCmMiNoNiPjMiBeC_xHqqkZx_
	DELETE_DOCUMENT
// 06.05.11 Fukushiro M. 1_xZkqqHx_iNhDiNoNiPjM_xHqqkZx_ ()
//	g_pMolipMainI = NULL;
} // ConvertFileToFcore.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	ConvertFcoreToFile
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDhEiDiJiDgCiDgHiDfCiDeBiCfC_xHqqkZx_ -> _xZkqqHx_iDhEiDeAiDeDiDiL_xHqqkZx_ _xZkqqHx_iCmMjFmPiKlHiCpAiNhDiCkEiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	pIMain	:DynamicDraw_xZkqqHx_iCmMiDiBiDeDiDjDiDeDiDjDiDfOiDhEiDeGiBfLiDfIiCpAiOhHjCoIiBeC_xHqqkZx_
 *			fileFrom	:_xZkqqHx_jDmHiCnNiPgPiClFiMlDiCmMiDeBiBfLiDeKiDeDiDhFiCpAiOhHjCoIiBeC_xHqqkZx_
 *			wcpFileTo	:_xZkqqHx_iPjBiCkLiNjOiCnNjAoGiCmMiDhEiDeAiDeDiDiLjGlMiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.06.12 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
// 06.05.11 Fukushiro M. 1_xZkqqHx_iNhDjFmPiNfI_xHqqkZx_ ()
//extern "C" void APIENTRY ConvertFcoreToFile (	IMpgMolipMain* pIMain,
extern "C" void APIENTRY ConvertFcoreToFile (	
												MfcFile* fileFrom,
												const wchar_t* wcpFileTo)
{
// 06.05.11 Fukushiro M. 1_xZkqqHx_iNhDiNoNiPjM_xHqqkZx_ ()
//	g_pMolipMainI = pIMain;

	// _xZkqqHx_iDiKiDfMiBfLiDfIiCpAiClBiCmM_xHqqkZx_DLL_xZkqqHx_iCmJjAnNjCoIiBeC_xHqqkZx_
// 06.05.06 Fukushiro M. 1_xZkqqHx_iNhDjFmPiNfI_xHqqkZx_ ()
//	AfxSetResourceHandle(GetModuleHandle(NULL));
	FCResourceHandleBackup rcBack(GetModuleHandle(NULL));

	// g_pDoc_xZkqqHx_iCmMiPiJiKpKiJlLiBeC_xHqqkZx_
	INIT_DOCUMENT

//----- 06.05.11 Fukushiro M. _xZkqqHx_jFmPiNfIjBeP_xHqqkZx_ ()-----
//	// _xZkqqHx_iDeBiBfLiDeKiDeDiDhFiCpAiNoMjAkMiBeC_xHqqkZx_
//	CArchive* arFrom = FFClassCreate((CArchive*)NULL);
//	arFrom->Initialize(fileFrom, FD_ARCHIVE_LOAD, g_pDoc);
//	// _xZkqqHx_iDfIiDgHiDiKiBfLiDiAiCpAjDmHiCnNiPgPiClHiBeC_xHqqkZx_
//	g_pDoc->InStreamCore(*arFrom, TRUE);
//	// _xZkqqHx_iDeBiBfLiDeKiDeDiDhFiCpAiNoNiPjMiBeC_xHqqkZx_
//	FFClassDelete(arFrom);
//----- 06.05.11 Fukushiro M. _xZkqqHx_jFmPiNfIiMoD_xHqqkZx_ ()-----
	// _xZkqqHx_iDeBiBfLiDeKiDeDiDhFiCpAiNoMjAkMiBeC_xHqqkZx_
	CFCMfcFile fileFrom2(fileFrom);
	CArchive arFrom(&fileFrom2, CArchive::load);
	arFrom.m_pDocument = g_pDoc;
	// _xZkqqHx_iDfIiDgHiDiKiBfLiDiAiCpAjDmHiCnNiPgPiClHiBeC_xHqqkZx_
	g_pDoc->InStreamCore(arFrom, TRUE);
//----- 06.05.11 Fukushiro M. _xZkqqHx_jFmPiNfIiPeJ_xHqqkZx_ ()-----

	// _xZkqqHx_iOhHjCoIiClDiCoKiClNiDhEiDeAiDeDiDiLiCmMiKgHjCkDiOhBiCpAjDlOiCoJiBeC_xHqqkZx_
	WString wstrExtension;
	FFUtilFileI->SplitFileName(NULL, &wstrExtension, wcpFileTo);
	// _xZkqqHx_iKgHjCkDiOhBiCkJiCoHiMfOiCpAiLiBiCnPiCoJiBeC_xHqqkZx_
	FTDocumentFormat df = FD_DTP_NONE;		// _xZkqqHx_iMfOjGlDiClFiBeC_xHqqkZx_
	if (_wcsicmp(wstrExtension.c_str(), FD_FILE_EXT_STANDARD_FORMAT) == 0)
	//----- Dynamic Draw Standard Format -----
	{
		df = FD_DTP_STANDARD_FORMAT;	// _xZkqqHx_jCmKiPoNiDhEiDeIiBfLiDhNiDgCiDgHiCmMjFlGiPjBiBeC_xHqqkZx_(.mdrw)
	} else
	if (_wcsicmp(wstrExtension.c_str(), FD_FILE_EXT_TEMPLATE_FORMAT) == 0)
	//----- Dynamic Draw Template Format -----
	{
		df = FD_DTP_TEMPLATE_FORMAT;	// _xZkqqHx_iDgFiDjDiDhGiDiMiBfLiDgHiDhEiDeIiBfLiDhNiDgCiDgHiCmMjFlGiPjBiBeC_xHqqkZx_(.mdwt)
	}
	// _xZkqqHx_iDhEiDeAiDeDiDiLiMfOiCpAiOhHjCoIiBeC_xHqqkZx_
	g_pDoc->SetFileType(df);
	BOOL bSucceed = FALSE;
	if (df == FD_DTP_STANDARD_FORMAT)
	//----- _xZkqqHx_jCmKiPoNiDhEiDeIiBfLiDhNiDgCiDgHiCmMjFlGiPjBiBeC_xHqqkZx_(.mdrw) -----
	{
		bSucceed = g_pDoc->OnSaveDocument(WStrToTStr(wcpFileTo));
	} else
	if (df == FD_DTP_TEMPLATE_FORMAT)
	//----- _xZkqqHx_iDgFiDjDiDhGiDiMiBfLiDgHiDhEiDeIiBfLiDhNiDgCiDgHiCmMjFlGiPjBiBeC_xHqqkZx_(.mdwt) -----
	{
		bSucceed = g_pDoc->SaveTemplate(wcpFileTo);
	}

	// g_pDoc_xZkqqHx_iCmMiNoNiPjMiBeC_xHqqkZx_
	DELETE_DOCUMENT

// 06.05.11 Fukushiro M. 1_xZkqqHx_iNhDiNoNiPjM_xHqqkZx_ ()
//	g_pMolipMainI = NULL;
} // ConvertFcoreToFile.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	AnalyzeVersion
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iOhHjCoIiCmMiDhEiDeAiDeDiDiLiCmMiDgPiBfLiDfHiDiHiDjDiCpAjClCiCnHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	pIMain		:DynamicDraw_xZkqqHx_iCmMiDiBiDeDiDjDiDeDiDjDiDfOiDhEiDeGiBfLiDfIiCpAiOhHjCoIiBeC_xHqqkZx_
 *			wstrVersion	:_xZkqqHx_iDgPiBfLiDfHiDiHiDjDiCpAjFnEiClHiBeC_xHqqkZx_
 *			wcpFilePath	:_xZkqqHx_jClCiCnHiCoJiDhEiDeAiDeDiDiLiCmMiDhEiDeAiDeDiDiLjGlMiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iDgPiBfLiDfHiDiHiDjDiCkKjElLjFmKiCmFiCkLiClNiPoKiNiHiCmN_xHqqkZx_TRUE_xZkqqHx_iBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.06.03 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
// 06.05.11 Fukushiro M. 1_xZkqqHx_iNhDjFmPiNfI_xHqqkZx_ ()
//extern "C" BOOL APIENTRY AnalyzeVersion (	IMpgMolipMain* pIMain,
extern "C" BOOL APIENTRY AnalyzeVersion (	
											WString& wstrVersion,
											const wchar_t* wcpFilePath)
{
// 06.05.11 Fukushiro M. 1_xZkqqHx_iNhDiNoNiPjM_xHqqkZx_ ()
//	g_pMolipMainI = pIMain;

	// _xZkqqHx_iDiKiDfMiBfLiDfIiCpAiClBiCmM_xHqqkZx_DLL_xZkqqHx_iCmJjAnNjCoIiBeC_xHqqkZx_
// 06.05.06 Fukushiro M. 1_xZkqqHx_iNhDjFmPiNfI_xHqqkZx_ ()
//	AfxSetResourceHandle(GetModuleHandle(NULL));
	FCResourceHandleBackup rcBack(GetModuleHandle(NULL));

	WString wstrExtension;
	FFUtilFileI->SplitFileName(NULL, &wstrExtension, wcpFilePath);

	FTDocumentFormat df = FD_DTP_NONE;		// _xZkqqHx_iMfOjGlDiClFiBeC_xHqqkZx_

	if (_wcsicmp(wstrExtension.c_str(), FD_FILE_EXT_STANDARD_FORMAT) == 0)
	//----- Dynamic Draw Standard Format -----
	{
		df = FD_DTP_STANDARD_FORMAT;	// _xZkqqHx_jCmKiPoNiDhEiDeIiBfLiDhNiDgCiDgHiCmMjFlGiPjBiBeC_xHqqkZx_(.mdrw)
	} else
	if (_wcsicmp(wstrExtension.c_str(), FD_FILE_EXT_TEMPLATE_FORMAT) == 0)
	//----- Dynamic Draw Template Format -----
	{
		df = FD_DTP_TEMPLATE_FORMAT;	// _xZkqqHx_iDgFiDjDiDhGiDiMiBfLiDgHiDhEiDeIiBfLiDhNiDgCiDgHiCmMjFlGiPjBiBeC_xHqqkZx_(.mdwt)
	}

	BOOL bSucceed = FALSE;

	if (df == FD_DTP_STANDARD_FORMAT)
	//----- _xZkqqHx_jCmKiPoNiDhEiDeIiBfLiDhNiDgCiDgHiCmMjFlGiPjBiBeC_xHqqkZx_(.mdrw) -----
	{
		// g_pDoc_xZkqqHx_iCmMiPiJiKpKiJlLiBeC_xHqqkZx_
		INIT_DOCUMENT

		// _xZkqqHx_iDhHiDgCiDfPiCmMiCnNjDmHiCnNiNjOiCnNiCmMjAnNjCoIiBeC_xHqqkZx_
		g_pDoc->SetHeaderLoadOnly(TRUE);
		if (g_pDoc->OnOpenDocument(WStrToTStr(wcpFilePath)))
		{
			wstrVersion = MC3HeaderInf::FileVersionToString(
							g_pDoc->GetHeaderInfo()->GetFileVersion());
			bSucceed = TRUE;
		}
		// g_pDoc_xZkqqHx_iCmMiNoNiPjMiBeC_xHqqkZx_
		DELETE_DOCUMENT
	} else
	if (df == FD_DTP_TEMPLATE_FORMAT)
	//----- _xZkqqHx_iDgFiDjDiDhGiDiMiBfLiDgHiDhEiDeIiBfLiDhNiDgCiDgHiCmMjFlGiPjBiBeC_xHqqkZx_(.mdwt) -----
	{
		try
		{
//----- 06.05.11 Fukushiro M. _xZkqqHx_jFmPiNfIjBeP_xHqqkZx_ ()-----
//			CArchive* ar = FFClassCreate((CArchive*)NULL);
//			ar->Initialize(wcpFilePath, FD_ARCHIVE_LOAD, NULL, TRUE);
//			MC3HeaderInf inf;
//			inf.InStream(*ar);
//			wstrVersion = MC3HeaderInf::FileVersionToString(inf.GetFileVersion());
//			// _xZkqqHx_iDeBiBfLiDeKiDeDiDhFiCpAiNoNiPjMiBeC_xHqqkZx_
//			FFClassDelete(ar);
//----- 06.05.11 Fukushiro M. _xZkqqHx_jFmPiNfIiMoD_xHqqkZx_ ()-----
			// _xZkqqHx_iDeBiBfLiDeKiDeDiDhFiCpAiNoMjAkMiBeC_xHqqkZx_
			CFile file(WStrToTStr(wcpFilePath), CFile::modeRead | CFile::shareDenyNone);
			CArchive ar(&file, CArchive::load);
			MC3HeaderInf inf;
			inf.InStream(ar);
			wstrVersion = MC3HeaderInf::FileVersionToString(inf.GetFileVersion());
			ar.Close();
			file.Close();
//----- 06.05.11 Fukushiro M. _xZkqqHx_jFmPiNfIiPeJ_xHqqkZx_ ()-----
			bSucceed = TRUE;
		} catch (CException* e)
		//----- _xZkqqHx_iDeHiDiJiBfLiPiIjHjN_xHqqkZx_ -----
		{
			e->Delete();
		}
	}
// 06.05.11 Fukushiro M. 1_xZkqqHx_iNhDiNoNiPjM_xHqqkZx_ ()
//	g_pMolipMainI = NULL;
	return bSucceed;
} // AnalyzeVersion.

