// FdbOpenDdFile.cpp : _xZkqqHx_iDeDiDjDiDhGiDiKiDiBiDjDiDgFiBfLiDfGiDiHiDjD_xHqqkZx_ _xZkqqHx_iDhEiDeAiDeDiDiL_xHqqkZx_
//

#include "stdafx.h"
// 06.04.25 Fukushiro M. 1_xZkqqHx_iNhDjFmPiNfI_xHqqkZx_ ()
//#include "resource.h"		// For IDD_SYS_DLG_OPEN_DDFILE.
#include "DynamicDraw.h"	// For IDD_SYS_DLG_OPEN_DDFILE,FFGetApp().
#include "UtilZlibPng.h"	// For FFPngRead32BitImageAndText.
#include "UtilErr.h"		// For CFCMiscException.
#include "UtilFile.h"		// For FFFileNameToFormat.
#include "UtilDlg.h"		// For FFSetDlgItemText.
//----- 06.10.20 Fukushiro M. _xZkqqHx_jCmHiJmBiOgO_xHqqkZx_ ()-----
#include "UtilStr.h"		// For FFExtractString.
#include "UtilWin.h"		// For FFGetLBText.
#include "RegData.h"		// For FCRegData.
//----- 06.10.20 Fukushiro M. _xZkqqHx_jCmHiJmBiPeJ_xHqqkZx_ ()-----
#include "FoundDoc.h"		// For FD_DPID_END.
#include "DynamicDb.h"	// For g_pFileServer.
#include "FdbOpenDdFile.h"	// This header.

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

//----- 06.10.20 Fukushiro M. _xZkqqHx_jCmHiJmBiOgO_xHqqkZx_ ()-----
// _xZkqqHx_iDgGiDeCiDiMiDeOiDgHiDiKiDiKiDfIiDgHiCnGiCmMiNmFjBoFiCmMjDgPjIfOjAjEiBeC_xHqqkZx_
static const int FD_OPEN_DD_DIR_LIST_MAX = 20;
//----- 06.10.20 Fukushiro M. _xZkqqHx_jCmHiJmBiPeJ_xHqqkZx_ ()-----

/*************************************************************************
 * <_xZkqqHx_iNfMjBkCjBmM_xHqqkZx_>	FCOpenDdfileThreadData
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_jFlGiPjBiDhEiDeAiDeDiDiLjDmHiCnNiNjOiCnNiDfIiDiMiDgCiDgIiCmGjDkPiKpKiCpAiCmGiCoJiClNiCnPiCmMiLkEjHeMiDiBiDiCiDiKiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	03.06.26 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
struct FCOpenDdfileThreadData
{
	FCAutoDeleteCriticalSection	m_csAccessMember;	// _xZkqqHx_iDiBiDjDiDgPjFmPjAjEiCnGiCmMiDeBiDeOiDfKiDfIiLjGiJmCiBeC_xHqqkZx_
	FCFdbOpenDdFile*	m_pFileDialog;		// FCFdbOpenDdFile_xZkqqHx_iCmMiDhMiDeDiDjDiDfOiBeC_xHqqkZx_
	WString				m_wstrFilePath;		// _xZkqqHx_jDmHiCnNiNjOiCnNiDhEiDeAiDeDiDiLjGlMiBeC_xHqqkZx_
	CSize				m_sz32Image;		// _xZkqqHx_iDeDiDiBiBfLiDfHiDfEiDeDiDfJiBeC_xHqqkZx_
	BYTEVector			m_v32Image;			// _xZkqqHx_iDeDiDiBiBfLiDfHiDgGiBfLiDfOiBeC_xHqqkZx_
	WString				m_wstraDocProperty[FD_DPID_END];	// _xZkqqHx_jFlGiPjBiDhGiDiNiDhAiDgFiDeCiBeC_xHqqkZx_
}; // struct FCOpenDdfileThreadData.

/////////////////////////////////////////////////////////////////////////////
// FCFdbOpenDdFile

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCFdbOpenDdFile::FCFdbOpenDdFile
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDfCiDjDiDfIiDgHiDiJiDeOiDfOiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	lpszDefExt		:_xZkqqHx_iDgGiDhEiDeIiDiLiDgHiCmMiKgHjCkDiOhBiCpAiOhHjCoIiBeC_xHqqkZx_
 *			lpszFileName	:_xZkqqHx_iDgGiDhEiDeIiDiLiDgHiCmMiDhEiDeAiDeDiDiLjGlMiCpAiOhHjCoIiBeC_xHqqkZx_
 *			dwFlags			:_xZkqqHx_iDfPiDeDiDeBiDiNiDePiDhEiDiJiDePiCpAiOhHjCoIiBeC_xHqqkZx_
 *			lpszFilter		:_xZkqqHx_iDhEiDeCiDiLiDfOiCpAiOhHjCoIiBeC_xHqqkZx_
 *			pParentWnd		:_xZkqqHx_jAgFiDeFiDeCiDjDiDgIiDeFiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iJpAjAoA_xHqqkZx_>	_xZkqqHx_iDgGiDhEiDeIiDiLiDgHiCmFiBeB_xHqqkZx_OPEN_xZkqqHx_iDfPiDeDiDeBiDiNiDePiCmJjAnNjCoIiClDiCoKiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	03.06.25 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
FCFdbOpenDdFile::FCFdbOpenDdFile (	const wchar_t* wcpDefExt,
									const wchar_t* wcpFileName,
									DWORD dwFlags,
									const wchar_t* wcpFilter,
									HWND hwndParent,
									const wchar_t* wcpTitle)
				: BASE_CLASS(	TRUE,
								wcpDefExt,
								wcpFileName,
								dwFlags,
								wcpFilter,
								hwndParent,
								wcpTitle)
{
	// _xZkqqHx_iDhEiDeAiDeDiDiLiDfPiDeDiDeBiDiNiDePiCmJiPgEiCmLiCoJiDgFiDjDiDhGiDiMiBfLiDgHiDiKiDfMiBfLiDfIiCpAjAnNjCoIiBeC_xHqqkZx_
	m_ofn.lpTemplateName = MAKEINTRESOURCE(IDD_SYS_DLG_OPEN_DDFILE);
	m_ofn.hInstance = FFGetApp()->GetResourceInstance();
	m_ofn.Flags |= OFN_ENABLETEMPLATE;
	// _xZkqqHx_iDhHiDiLiDhGiDhLiDfOiDjDiCpAjFfMiOkGiBeC_xHqqkZx_
	m_ofn.Flags |= OFN_SHOWHELP;
	// _xZkqqHx_iPpDiLlFiImLjBlGiDhHiDiLiDhGiCmM_xHqqkZx_ID_xZkqqHx_iCpAjAnNjCoIiBeC_xHqqkZx_
	SetHelpID(IDD_SYS_DLG_OPEN_DDFILE);

	// _xZkqqHx_jFlGiPjBiDhEiDeAiDeDiDiLjDmHiCnNiNjOiCnNiDfIiDiMiDgCiDgIiCmGiCmMiLkEjHeMiDgGiBfLiDfOiBeC_xHqqkZx_
	m_pThreadData = NULL;
	m_dwThreadId = DWORD(-1);
} // FCFdbOpenDdFile::FCFdbOpenDdFile.

//----- 05.10.12 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
///*************************************************************************
// * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCFdbOpenDdFile::~FCFdbOpenDdFile
// *
// * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDgGiDfIiDgHiDiJiDeOiDfOiBeC_xHqqkZx_
// *
// * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	03.06.27 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
// *************************************************************************/
//FCFdbOpenDdFile::~FCFdbOpenDdFile ()
//{
//} // FCFdbOpenDdFile::~FCFdbOpenDdFile.
//----- 05.10.12 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----

//----- 06.10.20 Fukushiro M. _xZkqqHx_jCmHiJmBiOgO_xHqqkZx_ ()-----
/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCFdbOpenDdFile::SetRegName
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDgGiDeCiDiMiDeOiDgHiDiKiDiKiDfIiDgHiCkKiLeMjIfOiClDiCoKiCoJiDiMiDfHiDfIiDgHiDiKjGlMiCpAjAnNjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	wcpRegName	:_xZkqqHx_iDiMiDfHiDfIiDgHiDiKjGlMiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	06.10.20 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void FCFdbOpenDdFile::SetRegName (const wchar_t* wcpRegName)
{
	m_wstrRegName.Format(L"FCFdbOpenDdFile::%s", wcpRegName);
} // FCFdbOpenDdFile::SetRegName.
//----- 06.10.20 Fukushiro M. _xZkqqHx_jCmHiJmBiPeJ_xHqqkZx_ ()-----

//----- 06.12.11 Fukushiro M. _xZkqqHx_jCmHiJmBiOgO_xHqqkZx_ ()-----
/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCFdbOpenDdFile::SetDefaultDirectory
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDgGiDeCiDiMiDeOiDgHiDiKiDiKiDfIiDgHiCkKiDiMiDfHiDfIiDgHiDiKjGkCjDgPjIfOiCmMiPoKiNiHiCmMiPiJiKpKiDgGiDeCiDiMiDeOiDgHiDiKiCpA_xHqqkZx_
 *			_xZkqqHx_jAnNjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	wcpPath	:_xZkqqHx_iPiJiKpKiDgGiDeCiDiMiDeOiDgHiDiKiDhAiDfIiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	06.12.11 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void FCFdbOpenDdFile::SetDefaultDirectory (const wchar_t* wcpPath)
{
	m_wstrDefaultDirPath = wcpPath;
} // FCFdbOpenDdFile::SetDefaultDirectory.
//----- 06.12.11 Fukushiro M. _xZkqqHx_jCmHiJmBiPeJ_xHqqkZx_ ()-----

/////////////////////////////////////////////////////////////////////////////
// FCFdbOpenDdFile _xZkqqHx_iDiGiBfLiDfFiKnGjAjEiBeC_xHqqkZx_

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	myCheckThreadMessage
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDhEiDeAiDeDiDiLjDmHiCnNiNjOiCnNiDfIiDiMiDgCiDgIjCiGiCmJiCkIiCkPiCoJiBeBiDeBiBfLiDeKiDeDiDhFiCmMiDfCiBfLiDiLiDgPiDgCiDeO_xHqqkZx_
 *			_xZkqqHx_iKnGjAjEiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	pArchive	:_xZkqqHx_iDeBiBfLiDeKiDeDiDhFiCpAiOhHjCoIiBeC_xHqqkZx_
 *			dwData		:_xZkqqHx_iDfCiBfLiDiLiDgPiDgCiDeOjAnNjCoIiOjOiCmMiIpIjAjEiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	03.06.28 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
static void myCheckThreadMessage (FCUndoArchive* pArchive, DWORD dwData)
{
	// _xZkqqHx_iDiBiDgCiDfKiBfLiDfHiCpAiKmEiOiLiClFiCmEiBeBjCmKjCgNiCkKiCkAiCmBiClNiPoKiNiHiCmNiDeHiDiJiBfLiCpAiDfIiDiNiBfLiBeC_xHqqkZx_
	// _xZkqqHx_iDeHiDiJiBfLiCmNiJlNiCmFiCoAjHmHiCkCiBeC_xHqqkZx_
	// _xZkqqHx_jBoFiCkLiCmIiDhEiDeAiDeDiDiLiCpAjDmHiCnNiNjOiCnNjCiGiCmJiBeBiDhEiDeIiDiLiDfPiCmMjBeJjBpAiCkKjFmPiNfIiClDiCoKiClNiPoKiNiHiBeB_xHqqkZx_
	// _xZkqqHx_jDmHiCnNiNjOiCnNiCpAjCiGjCgGiClFiCmEiOjPiCmMjDmHiCnNiNjOiCnNiNoMiLmGiCmJiInKiCoJiClNiCnPiBeC_xHqqkZx_
	MSG	msg;
	if (PeekMessage(&msg, NULL, WM_USER_LISTCTRL_SELCHANGED,
					WM_USER_LISTCTRL_SELCHANGED, PM_NOREMOVE))
	{
		FFThrowMiscException(IDS_ERR_MISC_NONE);
	}
} // myCheckThreadMessage.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	myLoadPngDataThread
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	MDRW/MDPF_xZkqqHx_iMgAiOkOiCmMiDgGiBfLiDfOiCkJiCoH_xHqqkZx_PNG_xZkqqHx_iCmMiDeDiDiBiBfLiDfHiPoOjFpBiCmGiDgFiDeMiDfIiDgHiPoOjFpBiCpA_xHqqkZx_
 *			_xZkqqHx_iOoGiCoIiPgPiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	pvoid	:_xZkqqHx_iLkEjHeMiDgGiBfLiDfOiCnGiCmMiDhMiDeDiDjDiDfOiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iDfIiDiMiDgCiDgIiCmMjAkMiMpHiBeFiOlIjEhDiCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	03.06.27 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
static DWORD WINAPI myLoadPngDataThread (LPVOID pvoid)
{
	FCOpenDdfileThreadData* pThreadData = (FCOpenDdfileThreadData*)pvoid;
	// _xZkqqHx_iDhEiDeAiDeDiDiLjGlMiBeC_xHqqkZx_
	WString wstrLastFilePath;
	for (;;)
	{
		// _xZkqqHx_iDiBiDjDiDgPjFmPjAjEiCnGiCmMiDeBiDeOiDfKiDfIiLjGiJmCiBeC_xHqqkZx_
		FCAutoLeaveCriticalSection atlcs(pThreadData->m_csAccessMember);
		FCFdbOpenDdFile* pFileDialog = pThreadData->m_pFileDialog;
		// _xZkqqHx_iDiBiDjDiDgPjFmPjAjEiCnGiCmMiDeBiDeOiDfKiDfIiLjGiJmCiBeC_xHqqkZx_
		atlcs.Leave();
		// _xZkqqHx_iDfPiDeDiDeBiDiNiDePjAnNjCoIiCkKiJpAiPjMiClDiCoKiCmEiCkCiCoKiCmOiPeJjHlJiBeC_xHqqkZx_
		if (pFileDialog == NULL) break;

		MSG	msg;
		if (PeekMessage(&msg, NULL, WM_USER_LISTCTRL_SELCHANGED,
						WM_USER_LISTCTRL_SELCHANGED, PM_REMOVE))
		{
			while (::PeekMessage(&msg, NULL, WM_USER_LISTCTRL_SELCHANGED,
								WM_USER_LISTCTRL_SELCHANGED, PM_REMOVE));

			// _xZkqqHx_iDiBiDjDiDgPjFmPjAjEiCnGiCmMiDeBiDeOiDfKiDfIiLjGiJmCiBeC_xHqqkZx_
			atlcs.Enter();
			// _xZkqqHx_iDhEiDeAiDeDiDiLjGlMiCpAiOoGjDlOiBeC_xHqqkZx_
			WString wstrNewFilePath = pThreadData->m_wstrFilePath;
			// _xZkqqHx_iDiBiDjDiDgPjFmPjAjEiCnGiCmMiDeBiDeOiDfKiDfIiLjGiJmCiBeC_xHqqkZx_
			atlcs.Leave();

			// _xZkqqHx_iDhEiDeAiDeDiDiLjGlMiCkKjDkPiClGiCmIiCoHiPiIjHjNiClFiCmIiCkCiBeC_xHqqkZx_
			if (wstrLastFilePath == wstrNewFilePath) continue;

			TRACE("Start Load Image\n");

			CSize sz32Image;		// _xZkqqHx_iDeDiDiBiBfLiDfHiDfEiDeDiDfJiBeC_xHqqkZx_
			BYTEVector v32Image;	// _xZkqqHx_iDeDiDiBiBfLiDfHiDgGiBfLiDfOiBeC_xHqqkZx_
			WString wstraDocProperty[FD_DPID_END];	// _xZkqqHx_jFlGiPjBiDhGiDiNiDhAiDgFiDeCiBeC_xHqqkZx_
			BOOL bSucceed = TRUE;
			LPSTORAGE lpStorage = NULL;
			try
			{
				// _xZkqqHx_iKgHjCkDiOhBiCkJiCoHiDhEiDeAiDeDiDiLiCmMiOoNjHnOiCpAiOoGjDlOiBeC_xHqqkZx_
				FTDocumentFormat df = FFFileNameToFormat(wstrNewFilePath);
				if (df == FD_DTP_STANDARD_FORMAT)
				//----- _xZkqqHx_jCmKiPoNiDhEiDeIiBfLiDhNiDgCiDgHiCmMjFlGiPjB_xHqqkZx_ -----
				{
					LPCOLESTR lpsz = wstrNewFilePath;
					// use STGM_CONVERT if necessary
					SCODE sc;
					// open new storage file
					sc = StgOpenStorage(lpsz, NULL, STGM_READ|STGM_TRANSACTED,
									0, 0, &lpStorage);
					if (FAILED(sc))
						FFThrowMiscException(IDS_ERR_MISC_NONE);

					// open Contents stream
					COleStreamFile file;
					CFileException fe;
					if (!file.OpenStream(lpStorage, _T("Contents"),
									CFile::modeRead|CFile::shareExclusive, &fe))
					{
						lpStorage->Release();
						FFThrowMiscException(IDS_ERR_MISC_NONE);
					}
					FCUndoArchive ar(&file, FD_ARCHIVE_LOAD);
					ar.SetCallback(myCheckThreadMessage, 0);
					// _xZkqqHx_iDhHiDgCiDfPiCmJiDgGiBfLiDfOiCpAjDmHiCnNiNjOiCnOiBeC_xHqqkZx_
					FCHeaderInf headerInf;
					headerInf.InStream(ar);
					// PNG_xZkqqHx_jDmHiCnNiNjOiCnNiBeC_xHqqkZx_
					// ar_xZkqqHx_iCmJjBmOiClFiCmEjBlMiCmMiDhGiDiNiDfKiDfIiCkJiCoHjCiGjCgGiCkKjDpMiCmBiClNiPoKiNiHiBeBjHoBiKePjEkNjAlGiBeC_xHqqkZx_
					FFPngRead32BitImageAndText(	ar,
												&sz32Image,
												&v32Image,
												wstraDocProperty,
												FD_DPID_END,
												FALSE);
					// PNG_xZkqqHx_iDeDiDiBiBfLiDfHiCpA_xHqqkZx_DIB_xZkqqHx_iDeDiDiBiBfLiDfHiCnGjFmPiKlHiBeC_xHqqkZx_
					FFPngImageToDIB32(v32Image.begin(), sz32Image);
					ar.Close();
					file.Close();
					lpStorage->Release();
				} else
				if (df == FD_DTP_PORTABLE_FORMAT ||	// _xZkqqHx_iDhMiBfLiDfOiDhFiDiLiDhEiDeIiBfLiDhNiDgCiDgHiCmMjFlGiPjBiBeC_xHqqkZx_
					df == FD_DTP_TEMPLATE_FORMAT)	// _xZkqqHx_iDgFiDjDiDhGiDiMiBfLiDgHiDhEiDeIiBfLiDhNiDgCiDgHiCmMjFlGiPjBiBeC_xHqqkZx_
				{
					// _xZkqqHx_jFlGiPjBiDhEiDeAiDeDiDiLiCpAiKeKiCkNiBeC_xHqqkZx_
					FCUndoArchive ar(wstrNewFilePath, FD_ARCHIVE_LOAD);
					ar.SetCallback(myCheckThreadMessage, 0);
					// PNG_xZkqqHx_jDmHiCnNiNjOiCnNiBeC_xHqqkZx_
					// ar_xZkqqHx_iCmJjBmOiClFiCmEjBlMiCmMiDhGiDiNiDfKiDfIiCkJiCoHjCiGjCgGiCkKjDpMiCmBiClNiPoKiNiHiBeBjHoBiKePjEkNjAlGiBeC_xHqqkZx_
					FFPngRead32BitImageAndText(	ar,
												&sz32Image,
												&v32Image,
												wstraDocProperty,
												FD_DPID_END,
												FALSE);
					// PNG_xZkqqHx_iDeDiDiBiBfLiDfHiCpA_xHqqkZx_DIB_xZkqqHx_iDeDiDiBiBfLiDfHiCnGjFmPiKlHiBeC_xHqqkZx_
					FFPngImageToDIB32(v32Image.begin(), sz32Image);
					ar.Close();
				} else
				{
					// _xZkqqHx_iOhHjCoIiImIiKePiCmMiDhEiDeIiBfLiDhNiDgCiDgHiCmNiDeHiDiJiBfLiCpAiDfIiDiNiBfLiBeC_xHqqkZx_
					// _xZkqqHx_iJlKiCmFiDeMiDiDiDgCiDgAiClDiCoKiCoJiCmMiCmFiBeBjGoCjBoIiCmJiCmNiCmIiCoHiCmIiCkCiBeC_xHqqkZx_
					FFThrowMiscException(IDS_ERR_MISC_NONE);
				}
			} catch (CException* e)
			{
				bSucceed = FALSE;
				if (lpStorage != NULL)
					lpStorage->Release();
				e->Delete();
			}
			// _xZkqqHx_iDiBiDjDiDgPjFmPjAjEiCnGiCmMiDeBiDeOiDfKiDfIiLjGiJmCiBeC_xHqqkZx_
			atlcs.Enter();
			if (pThreadData->m_pFileDialog != NULL)
			{
				if (bSucceed)
				//----- _xZkqqHx_jDmHiCnNiNjOiCnNiCmJjAkMiMpHiClFiClNiPoKiNiH_xHqqkZx_ -----
				{
					// _xZkqqHx_jBePiJpBiCmMiDhEiDeAiDeDiDiLjGlMiCpAjAnNjCoIiBeC_xHqqkZx_
					wstrLastFilePath = wstrNewFilePath;
					// _xZkqqHx_iDeDiDiBiBfLiDfHiDfEiDeDiDfJiBeC_xHqqkZx_
					pThreadData->m_sz32Image = sz32Image;
					// _xZkqqHx_iDeDiDiBiBfLiDfHiDgGiBfLiDfOiBeC_xHqqkZx_
					pThreadData->m_v32Image = v32Image;
					// _xZkqqHx_jFlGiPjBiDhGiDiNiDhAiDgFiDeCiBeC_xHqqkZx_
					for (long lC = 0; lC < FD_DPID_END; lC++)
						pThreadData->m_wstraDocProperty[lC] = wstraDocProperty[lC];
				} else
				//----- _xZkqqHx_jDmHiCnNiNjOiCnNiCmJiOlIjEhDiClFiClNiPoKiNiH_xHqqkZx_ -----
				{
					// _xZkqqHx_jBePiJpBiCmMiDhEiDeAiDeDiDiLjGlMiCpAiDeOiDiKiDeBiBeC_xHqqkZx_
					wstrLastFilePath.Empty();
					// _xZkqqHx_iDeDiDiBiBfLiDfHiDfEiDeDiDfJiBeC_xHqqkZx_
					pThreadData->m_sz32Image = CSize(0, 0);
					// _xZkqqHx_iDeDiDiBiBfLiDfHiDgGiBfLiDfOiBeC_xHqqkZx_
					pThreadData->m_v32Image.clear();
					// _xZkqqHx_jFlGiPjBiDhGiDiNiDhAiDgFiDeCiBeC_xHqqkZx_
					for (long lC = 0; lC < FD_DPID_END; lC++)
						pThreadData->m_wstraDocProperty[lC].erase();
				}
				// PNG_xZkqqHx_jDmHiCnNiNjOiCnNiPeJjHlJiCpAjCmKjCgNiBeC_xHqqkZx_
				pThreadData->m_pFileDialog->PostMessage(WM_USER_PNG_DATA_LOADED, 0, 0);
			}
			// _xZkqqHx_iDiBiDjDiDgPjFmPjAjEiCnGiCmMiDeBiDeOiDfKiDfIiLjGiJmCiBeC_xHqqkZx_
			atlcs.Leave();
		}
	}
	// _xZkqqHx_iNfMjBkCjBmMiCpAiNoNiPjMiBeC_xHqqkZx_
	delete pThreadData;
	// _xZkqqHx_jAlDiPoNiPeJjHlJiBeC_xHqqkZx_
    return S_OK;
} // myLoadPngDataThread.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCFdbOpenDdFile::OnFileNameChanged
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDhEiDeAiDeDiDiLjGlMiCkKjFmPiNfIiClDiCoKiClNiOjOiCmJiOmAiNhDiClDiCoKiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iPnKiNnH_xHqqkZx_>	_xZkqqHx_jAgFiDfPiDeDiDeBiDiNiDePiDhGiDiNiDfGiDfHiDiDiCkJiCoHiOmAiNhDiClDiCoKiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	03.06.25 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void FCFdbOpenDdFile::OnFileNameChanged ()
{
	// Superclass_xZkqqHx_iKnGjAjEiOmAiNhDiBeC_xHqqkZx_
	BASE_CLASS::OnFileNameChanged();
	// _xZkqqHx_iDhEiDeAiDeDiDiLiDhAiDfIiBeC_xHqqkZx_
	WString wstrFilePath;
	// _xZkqqHx_iDhEiDeAiDeDiDiLjGlMiCpAiOoGjDlOiBeC_xHqqkZx_
	WString wstrFileName = GetFileName();
	if (!wstrFileName.IsEmpty())
	//----- _xZkqqHx_iDhEiDeAiDeDiDiLjGlMiCkKiOhHjCoIiClDiCoKiCmEiCkCiCoJiPoKiNiH_xHqqkZx_ -----
	{
		// _xZkqqHx_iDhEiDeAiDeDiDiLjGlMiCmMiDeFiDeCiDjDiDgIiDeFiCmJjAnNjCoIiClDiCoKiCmEiCkCiCoJjFlGiOjKjHpBiCpAiOoGjDlOiBeC_xHqqkZx_
		// GetPathName, CDM_GETFILEPATH_xZkqqHx_iDiBiDgCiDfKiBfLiDfHiCmFiCmNiBeBjBeJjBpAjAnIiCoIjBnGiCkGjBePiCmM_xHqqkZx_
		// _xZkqqHx_iDhEiDeAiDeDiDiLjGlMiCpAiOoGjDlOiClFiCmEiClFiCnMiCkEiBeC_xHqqkZx_
		// GetFileName_xZkqqHx_iCmNjAfGiClFiCkCiDhEiDeAiDeDiDiLjGlMiCpAiOoGjDlOiCmFiCkLiCoJiBeC_xHqqkZx_GetFolderPath_xZkqqHx_iCoA_xHqqkZx_
		// _xZkqqHx_jAfGiClFiCkCiDhEiDeIiDiLiDfPjGlMiCpAiOoGjDlOiCmFiCkLiCoJiBeC_xHqqkZx_
		WString wstrDirPath = GetFolderPath();
		if (wstrDirPath.GetLast() != L'\\')
			wstrDirPath += L'\\';
		wstrFilePath = wstrDirPath + wstrFileName;
	}
	// _xZkqqHx_iDiBiDjDiDgPjFmPjAjEiCnGiCmMiDeBiDeOiDfKiDfIiLjGiJmCiBeC_xHqqkZx_
	FCAutoLeaveCriticalSection atlcs(m_pThreadData->m_csAccessMember);
	m_pThreadData->m_wstrFilePath = wstrFilePath;
	// _xZkqqHx_iDhEiDeAiDeDiDiLjDmHiCnNiNjOiCnNiDfIiDiMiDgCiDgIiCmJiDhEiDeAiDeDiDiLjGlMjFmPiNfIiCpAjCmKjCgNiBeC_xHqqkZx_
	PostThreadMessage(m_dwThreadId, WM_USER_LISTCTRL_SELCHANGED, 0, 0);
} // FCFdbOpenDdFile::OnFileNameChanged.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCFdbOpenDdFile::OnMessage
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDfPiDeDiDeBiDiNiDePiCmJjBjHiCoHiCoKiClNiDiBiDgCiDfKiBfLiDfHiCpAiPiIjHjNiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	dwMessageId	:_xZkqqHx_iDiBiDgCiDfKiBfLiDfH_xHqqkZx_ID_xZkqqHx_iCpAiOhHjCoIiBeC_xHqqkZx_
 *			wParam	:_xZkqqHx_iDiBiDgCiDfKiBfLiDfHiCmMiDhAiDiJiDiBiBfLiDfOiCpAiOhHjCoIiBeC_xHqqkZx_
 *			lParam	:_xZkqqHx_iDiBiDgCiDfKiBfLiDfHiCmMiDhAiDiJiDiBiBfLiDfOiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iClBiCmMiKnGjAjEiCmFiPiIjHjNiCmFiCkLiClNiPoKiNiHiCmN_xHqqkZx_ 0 _xZkqqHx_iImIiKePiBeBiPiIjHjNiCmFiCkLiCmIiCkCiPoKiNiHiCmN_xHqqkZx_ 0_xZkqqHx_iBeC_xHqqkZx_
 *			0 _xZkqqHx_iCpAjFnEiClFiClNiPoKiNiHiCmNiBeBiDgGiDhEiDeIiDiLiDgHiCmMiPiIjHjNiCkKiOmAiNhDiClDiCoKiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.10.12 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
UINT_PTR FCFdbOpenDdFile::OnMessage (DWORD dwMessageId, WPARAM wParam, LPARAM lParam)
{
	switch (dwMessageId)
	{
	case WM_USER_PNG_DATA_LOADED:
		return OnUserPngDataLoaded(wParam, lParam);
	default:
		return BASE_CLASS::OnMessage(dwMessageId, wParam, lParam);
	}
} // FCFdbOpenDdFile::OnMessage.

//----- 06.10.20 Fukushiro M. _xZkqqHx_jCmHiJmBiOgO_xHqqkZx_ ()-----
/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCFdbOpenDdFile::OnCommand
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	WM_COMMAND_xZkqqHx_iDiBiDgCiDfKiBfLiDfHiCpAiPiIjHjNiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	wParam	:_xZkqqHx_iDiBiDgCiDfKiBfLiDfHiCmMiDhAiDiJiDiBiBfLiDfOiCpAiOhHjCoIiBeC_xHqqkZx_
 *			lParam	:_xZkqqHx_iDiBiDgCiDfKiBfLiDfHiCmMiDhAiDiJiDiBiBfLiDfOiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iClBiCmMiKnGjAjEiCmFiPiIjHjNiCmFiCkLiClNiPoKiNiHiCmN_xHqqkZx_ TRUE_xZkqqHx_iBeBiPiIjHjNiCmFiCkLiCmIiCkCiPoKiNiHiCmN_xHqqkZx_ FALSE_xZkqqHx_iBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	06.10.20 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
BOOL FCFdbOpenDdFile::OnCommand (WPARAM wParam, LPARAM lParam)
{
	if (HIWORD(wParam) == CBN_SELCHANGE &&
		LOWORD(wParam) == IDC_ODF_CMB_DIRECTORY_LIST)
	//----- _xZkqqHx_iDgGiDeCiDiMiDeOiDgHiDiKiDiKiDfIiDgHiCmMjBeJjBpAiCkKjFmPiNfIiClDiCoKiClNiPoKiNiH_xHqqkZx_ -----
	{
		int iCurSel = ((CComboBox*)GetDlgItem(IDC_ODF_CMB_DIRECTORY_LIST))->GetCurSel();
		WString wstrDirPath;
		FFGetLBText((CComboBox*)GetDlgItem(IDC_ODF_CMB_DIRECTORY_LIST),
					iCurSel,
					wstrDirPath);
		// _xZkqqHx_iDgGiDeCiDiMiDeOiDgHiDiKiCpAiInKjDkOiClDiClJiCoJiClNiCnPiBeBiDhEiDeAiDeDiDiLjGlMiCmJ_xHqqkZx_
		// _xZkqqHx_iDgGiDeCiDiMiDeOiDgHiDiKiDhAiDfIiCpAjDpMjHmNiClFiCmE_xHqqkZx_OK_xZkqqHx_iCpAiJjPiClHiBeC_xHqqkZx_
		SetFileName(wstrDirPath.c_str());
		TwSendMessage(WM_COMMAND, IDOK, 0);
		return TRUE;
	}
	// Baseclass_xZkqqHx_iKnGjAjEiOmAiNhDiBeC_xHqqkZx_
	return BASE_CLASS::OnCommand(wParam, lParam);
} // FCFdbOpenDdFile::OnCommand.
//----- 06.10.20 Fukushiro M. _xZkqqHx_jCmHiJmBiPeJ_xHqqkZx_ ()-----

//----- 05.10.12 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
//void FCFdbOpenDdFile::DoDataExchange(CDataExchange* pDX)
//{
//	BASE_CLASS::DoDataExchange(pDX);
//	//{{AFX_DATA_MAP(FCFdbOpenDdFile)
//	DDX_Control(pDX, IDC_ODF_STC_IMAGE, m_stcImage);
//	//}}AFX_DATA_MAP
//} // FCFdbOpenDdFile::DoDataExchange.
//----- 05.10.12 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCFdbOpenDdFile::OnInitDialog
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDfPiDeDiDeBiDiNiDePiPiJiKpKiJlLiKnGjAjEiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	03.06.25 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
BOOL FCFdbOpenDdFile::OnInitDialog ()
{
	// MFC_xZkqqHx_iCmM_xHqqkZx_DDX_Control_xZkqqHx_iKnGjAjEiCoGiCoIiBeCiDfCiDjDiDgHiDiNiBfLiDiLiCpAjChFiCkLiKlHiCkGiCoJiBeC_xHqqkZx_
	DDXControl(IDC_ODF_STC_IMAGE, m_stcImage);

	// Superclass_xZkqqHx_iKnGjAjEiBeC_xHqqkZx_
	if (!BASE_CLASS::OnInitDialog())
		return FALSE;

	m_pThreadData = new FCOpenDdfileThreadData;
	// FCFdbOpenDdFile_xZkqqHx_iCmMiDhMiDeDiDjDiDfOiBeC_xHqqkZx_
	m_pThreadData->m_pFileDialog = this;

	// _xZkqqHx_jDmHiCnNiNjOiCnNiDfIiDiMiDgCiDgIiCpAiLeOjDkOiBeC_xHqqkZx_
	(void)CreateThread(NULL, 0, (PTHREAD_START_ROUTINE)myLoadPngDataThread,
						(LPVOID)m_pThreadData, 0, &m_dwThreadId);

//----- 06.10.20 Fukushiro M. _xZkqqHx_jCmHiJmBiOgO_xHqqkZx_ ()-----
	//----- _xZkqqHx_iDgGiDeCiDiMiDeOiDgHiDiKiDiKiDfIiDgHiCpAiOoGjDlO_xHqqkZx_ -----
	WString wstrList;
	// _xZkqqHx_iDiMiDfHiDfIiDgHiDiKiCkJiCoHiDgGiDeCiDiMiDeOiDgHiDiKiDiKiDfIiDgHiCpAiOoGjDlOiBeC_xHqqkZx_
	g_pReg->LoadRegString(NULL, m_wstrRegName, wstrList);
	if (!wstrList.IsEmpty())
	//----- _xZkqqHx_iDiMiDfHiDfIiDgHiDiKiCmJjDgPjIfOiClDiCoKiCmEiCkCiCoJiPoKiNiH_xHqqkZx_ -----
	{
		while (!wstrList.IsEmpty())
		{
			// _xZkqqHx_iDiKiDfIiDgHjFlGiOjKjHpBiCkJiCoHiDiKiDfIiDgHiCfAiDiMiDfCiBfLiDgIiCpAiOoGjDlOiBeC_xHqqkZx_
			WString wstr = FFExtractString(wstrList);
			// _xZkqqHx_iDfCiDjDiDhLiDhLiDgCiDeOiDfIiCmJiDiKiDfIiDgHiCpAjDgPjIfOiBeC_xHqqkZx_
			FFAddString((CComboBox*)GetDlgItem(IDC_ODF_CMB_DIRECTORY_LIST), wstr.c_str());
		}
	} else
	if (!m_wstrDefaultDirPath.IsEmpty())
	//----- _xZkqqHx_iDgGiDhEiDeIiDiLiDgHiDgGiDeCiDiMiDeOiDgHiDiKiCkKjAnNjCoIiClDiCoKiCmEiCkCiCoJiPoKiNiH_xHqqkZx_ -----
	{
		// _xZkqqHx_iDfCiDjDiDhLiDhLiDgCiDeOiDfIiCmJiDiKiDfIiDgHiCpAjDgPjIfOiBeC_xHqqkZx_
		FFAddString((CComboBox*)GetDlgItem(IDC_ODF_CMB_DIRECTORY_LIST), m_wstrDefaultDirPath.c_str());
	}
	if (((CComboBox*)GetDlgItem(IDC_ODF_CMB_DIRECTORY_LIST))->GetCount() != 0)
	//----- _xZkqqHx_iDfCiDjDiDhLiDhLiDgCiDeOiDfIiCmJiDeBiDeDiDgFiDiAiCkKjAnNjCoIiClDiCoKiCmEiCkCiCoJiPoKiNiH_xHqqkZx_ -----
	{
		// _xZkqqHx_iDeDiDjDiDgGiDgCiDeOiDfIiCePiCpAiDeKiDiMiDjDiDgHiCmJiBeC_xHqqkZx_
		((CComboBox*)GetDlgItem(IDC_ODF_CMB_DIRECTORY_LIST))->SetCurSel(0);
		// _xZkqqHx_jFmPiNfIiCpAjCmKjCgNiBeCiDgGiDeCiDiMiDeOiDgHiDiKiCpAjFmPiNfIiClDiClJiCoJiBeC_xHqqkZx_
		TwSendMessage(WM_COMMAND, MAKEWPARAM(IDC_ODF_CMB_DIRECTORY_LIST, CBN_SELCHANGE), 0);
	}
//----- 06.10.20 Fukushiro M. _xZkqqHx_jCmHiJmBiPeJ_xHqqkZx_ ()-----
	return TRUE;  // _xZkqqHx_iDfCiDjDiDgHiDiNiBfLiDiLiCmJiDhEiDeIiBfLiDeKiDfIiCpAjAnNjCoIiClFiCmIiCkCiCmGiCkLiBeBjGnPiCoIjCgMiCmN_xHqqkZx_ TRUE _xZkqqHx_iCmGiCmIiCoIiCnMiClH_xHqqkZx_
	              // _xZkqqHx_jHoBiKeP_xHqqkZx_: OCX _xZkqqHx_iDhGiDiNiDhAiDgFiDeC_xHqqkZx_ _xZkqqHx_iDhJiBfLiDfHiCmMjGnPiCoIjCgMiCmN_xHqqkZx_ FALSE _xZkqqHx_iCmGiCmIiCoIiCnMiClH_xHqqkZx_
} // FCFdbOpenDdFile::OnInitDialog.

//----- 06.10.20 Fukushiro M. _xZkqqHx_jCmHiJmBiOgO_xHqqkZx_ ()-----
/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCFdbOpenDdFile::OnOK
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	OK_xZkqqHx_iDhLiDfOiDjDiCkKiJjPiClDiCoKiClNiCmGiCkLiCmJiOmAiNhDiClDiCoKiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jCiNiInD_xHqqkZx_>	_xZkqqHx_jCmKiPoNiCmMiDfPiDeDiDeBiDiNiDePiCmM_xHqqkZx_OnOK_xZkqqHx_iCmGiCmNiIoBiCkEiBeCiDiGiBfLiDfFjCoIiLgAiCmM_xHqqkZx_virtual_xZkqqHx_iKnGjAjEiCmFiCkAiCoIiBeB_xHqqkZx_
 *			myDlgProc_xZkqqHx_iCkJiCoHiOmAiNhDiClDiCoKiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	06.10.20 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void FCFdbOpenDdFile::OnOK ()
{
	// Superclass_xZkqqHx_iKnGjAjEiOmAiNhDiBeC_xHqqkZx_
	BASE_CLASS::OnOK();
//----- 06.10.20 Fukushiro M. _xZkqqHx_jCmHiJmBiOgO_xHqqkZx_ ()-----
	//----- _xZkqqHx_iDgGiDeCiDiMiDeOiDgHiDiKiDiKiDfIiDgHiCpAjAnNjCoI_xHqqkZx_ -----
	// _xZkqqHx_iDgGiDeCiDiMiDeOiDgHiDiKiIoKjHjHiBeC_xHqqkZx_
	WString wstrList;
	// _xZkqqHx_iMlLiNnNiCmMiDgGiDeCiDiMiDeOiDgHiDiKiCpAjCmHiJmBiBeC_xHqqkZx_
	FFAppendString(wstrList, GetFolderPath());
	// _xZkqqHx_jDgPjIfOiNmPiCnNiDgGiDeCiDiMiDeOiDgHiDiKiPfHiNiHiBeC_xHqqkZx_
	WStringSet stList;
	stList.insert(GetFolderPath());
	// _xZkqqHx_iDfCiDjDiDhLiDhLiDgCiDeOiDfIiCmJjDgPjIfOiClDiCoKiClNiDiKiDfIiDgHjAjEiBeC_xHqqkZx_
	int iCount = ((CComboBox*)GetDlgItem(IDC_ODF_CMB_DIRECTORY_LIST))->GetCount();
	for (int index = 0;
		 index != iCount && stList.size() != FD_OPEN_DD_DIR_LIST_MAX;
		 index++)
	//----- _xZkqqHx_iDfCiDjDiDhLiDhLiDgCiDeOiDfIiCpAiDiLiBfLiDhG_xHqqkZx_ -----
	{
		// _xZkqqHx_iDfCiDjDiDhLiDhLiDgCiDeOiDfIiCmJjDgPjIfOiClDiCoKiClNjFlGiOjKjHpBiCpAiOoGjDlOiBeC_xHqqkZx_
		WString wstrDirPath;
		FFGetLBText((CComboBox*)GetDlgItem(IDC_ODF_CMB_DIRECTORY_LIST),
					index,
					wstrDirPath);
		if (stList.find(wstrDirPath) == stList.end())
		//----- _xZkqqHx_jFlGiOjKjHpBiBgJiDgGiDeCiDiMiDeOiDgHiDiKiBgKiCkKjGkCjDgPjIfOiCmMiPoKiNiH_xHqqkZx_ -----
		{
			// _xZkqqHx_iDgGiDeCiDiMiDeOiDgHiDiKiIoKjHjHiCmJjDgPjIfOiBeC_xHqqkZx_
			FFAppendString(wstrList, wstrDirPath);
			// _xZkqqHx_jDgPjIfOiNmPiCnNiPfHiNiHiCmJjDgPjIfOiBeC_xHqqkZx_
			stList.insert(wstrDirPath);
		}
	}
	// _xZkqqHx_iDiMiDfHiDfIiDgHiDiKiCmJiPjBiCkLiPgPiClFiBeC_xHqqkZx_
	g_pReg->SaveRegString(NULL, m_wstrRegName, wstrList);
//----- 06.10.20 Fukushiro M. _xZkqqHx_jCmHiJmBiPeJ_xHqqkZx_ ()-----
} // FCFdbOpenDdFile::OnOK.
//----- 06.10.20 Fukushiro M. _xZkqqHx_jCmHiJmBiPeJ_xHqqkZx_ ()-----

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCFdbOpenDdFile::OnSize
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDeFiDeCiDjDiDgIiDeFiCmMiDfEiDeDiDfJiCkKjFmPiNfIiClDiCoKiClNiCmGiCkLiCmJiOmAiNhDiClDiCoKiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	nType	:_xZkqqHx_iDiKiDfEiDeDiDfJiCmMiDfOiDeDiDhGiCpAiOhHjCoIiBeC_xHqqkZx_
 *			cx		:_xZkqqHx_jAfGiClFiCkCiDeFiDeCiDjDiDgIiDeFiDfEiDeDiDfJiCpAiOhHjCoIiBeC_xHqqkZx_
 *			cy		:_xZkqqHx_jAfGiClFiCkCiDeFiDeCiDjDiDgIiDeFiDfEiDeDiDfJiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	03.06.26 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void FCFdbOpenDdFile::OnSize (UINT nType, int cx, int cy)
{
	// Superclass_xZkqqHx_iKnGjAjEiBeC_xHqqkZx_
	BASE_CLASS::OnSize(nType, cx, cy);
	// _xZkqqHx_iDfPiDeDiDeBiDiNiDePiCmMiDfIiDeOiDiKiBfLiDjDiLoJiMgAiNmAjFfHiCpAiOoGjDlOiBeC_xHqqkZx_
	CRect rtDialog;
	GetWindowRect(rtDialog);
	// _xZkqqHx_iDhHiDiLiDhGiDhLiDfOiDjDiCmMiDfIiDeOiDiKiBfLiDjDiLoJiMgAiNmAjFfHiCpAiOoGjDlOiBeC_xHqqkZx_
	CRect rtHelp;
	GetParent()->GetDlgItem(psh15)->GetWindowRect(rtHelp);
	// _xZkqqHx_iDhHiDiLiDhGiDhLiDfOiDjDiCmGiDfPiDeDiDeBiDiNiDePiCmMiDeNiDiDiDgCiDhGiCpAiOoGjDlOiBeC_xHqqkZx_
	long wVertGap = rtDialog.bottom - rtHelp.bottom;
	// _xZkqqHx_iDhGiDiNiDhAiDgFiDeCjFfMiOkGjIgHiCmMiNmAjFfHiCpAiOoGjDlOiBeC_xHqqkZx_
	CRect rtEdtProperty;
	GetDlgItem(IDC_ODF_EDT_PROPERTY)->GetWindowRect(rtEdtProperty);
	ScreenToClient(&rtEdtProperty);

//----- 03.06.26 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
//	TRACE("PROP RECT %d %d %d %d\n", rtEdtProperty.left, rtEdtProperty.top,
//									rtEdtProperty.right, rtEdtProperty.bottom);
//----- 03.06.26 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----
	// _xZkqqHx_iDfPiDeDiDeBiDiNiDePiCmMiDeOiDiJiDeDiDeBiDjDiDgHjHmMiIoGiCpAiOoGjDlOiBeC_xHqqkZx_
	CRect rtClient;
	GetClientRect(rtClient);
	// _xZkqqHx_iDhGiDiNiDhAiDgFiDeCjFfMiOkGjIgHiCmM_xHqqkZx_bottom_xZkqqHx_jCgMiCpAiPeDjAlDiBeC_xHqqkZx_
	rtEdtProperty.bottom = rtClient.bottom - wVertGap;
	// _xZkqqHx_iDhGiDiNiDhAiDgFiDeCjFfMiOkGjIgHiCpAiDiKiDfEiDeDiDfJiBeC_xHqqkZx_
	GetDlgItem(IDC_ODF_EDT_PROPERTY)->MoveWindow(rtEdtProperty.left, rtEdtProperty.top,
												rtEdtProperty.Width(), rtEdtProperty.Height());

//----- 06.10.20 Fukushiro M. _xZkqqHx_jCmHiJmBiOgO_xHqqkZx_ ()-----
	//----- _xZkqqHx_iDgGiDeCiDiMiDeOiDgHiDiKiDiKiDfIiDgHiCpAiDiKiDfEiDeDiDfJ_xHqqkZx_ ------
	// _xZkqqHx_iDgGiDeCiDiMiDeOiDgHiDiKiDiKiDfIiDgHiCmMiNmAjFfHiCpAiOoGjDlOiBeC_xHqqkZx_
	CRect rtCmbDirList;
	GetDlgItem(IDC_ODF_CMB_DIRECTORY_LIST)->GetWindowRect(rtCmbDirList);
	ScreenToClient(&rtCmbDirList);
	rtCmbDirList.right = rtEdtProperty.left - rtCmbDirList.left;
	// _xZkqqHx_iDgGiDeCiDiMiDeOiDgHiDiKiDiKiDfIiDgHiCpAiDiKiDfEiDeDiDfJiBeC_xHqqkZx_
	GetDlgItem(IDC_ODF_CMB_DIRECTORY_LIST)->MoveWindow(	rtCmbDirList.left,
														rtCmbDirList.top,
														rtCmbDirList.Width(),
														rtCmbDirList.Height());
//----- 06.10.20 Fukushiro M. _xZkqqHx_jCmHiJmBiPeJ_xHqqkZx_ ()-----
} // FCFdbOpenDdFile::OnSize.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCFdbOpenDdFile::OnUserPngDataLoaded
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDfIiDiMiDgCiDgIiCmF_xHqqkZx_PNG_xZkqqHx_iDgGiBfLiDfOiCmMjDmHiCnNiNjOiCnNiCkKiPeJjHlJiClFiClNiOjOiCmJiOmAiNhDiClDiCoKiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	wParam	:_xZkqqHx_iDfIiDiMiDgCiDgIiLkEjHeMiDgGiBfLiDfOiCmMiOkPjFmKiDeKiDeFiDjDiDfOiCpAiOhHjCoIiBeC_xHqqkZx_
 *			lParam	:_xZkqqHx_jGkCiOgHjHhAiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iPoNiCmJiCfAiCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	03.06.27 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
LRESULT FCFdbOpenDdFile::OnUserPngDataLoaded (WPARAM wParam, LPARAM lParam)
{
	if (m_pThreadData != NULL)
	{
		// _xZkqqHx_iDiBiDjDiDgPjFmPjAjEiCnGiCmMiDeBiDeOiDfKiDfIiLjGiJmCiBeC_xHqqkZx_
		FCAutoLeaveCriticalSection atlcs(m_pThreadData->m_csAccessMember);
		TRACE(_T("FCFdbOpenDdFile::OnUserPngDataLoaded %d\n"), m_pThreadData->m_v32Image.size());
		m_stcImage.SetImage(m_pThreadData->m_sz32Image,
							m_pThreadData->m_v32Image.begin(),
							m_pThreadData->m_v32Image.size());

		WString wstrMessage;
		for (long lId = 0; lId < FD_DPID_END; lId++)
		{
			if (!m_pThreadData->m_wstraDocProperty[lId].empty())
			{
				wstrMessage += L"[";
				wstrMessage += FFDocumentPropertyIdToIKey(FTDocumentPropertyId(lId));
				wstrMessage += L"]\n";
				// _xZkqqHx_jFlGiPjBiDhGiDiNiDhAiDgFiDeCiBeC_xHqqkZx_
				wstrMessage += m_pThreadData->m_wstraDocProperty[lId];
				wstrMessage += L"\n";
			}
		}
		wstrMessage.Replace(L"\n", L"\r\n");
		FFSetDlgItemText(m_hWnd, IDC_ODF_EDT_PROPERTY, wstrMessage);
	}
	return 1;
} // FCFdbOpenDdFile::OnUserPngDataLoaded.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCFdbOpenDdFile::OnDestroy
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDhEiDeAiDeDiDiLiDfPiDeDiDeBiDiNiDePiNoNiPjMiOjOiCmJiOmAiNhDiClDiCoKiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.08.03 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void FCFdbOpenDdFile::OnDestroy ()
{
	if (m_pThreadData != NULL)
	//----- _xZkqqHx_iNkBiJnCjDkOjCiGiCmMiDfIiDiMiDgCiDgIiCmGiLkEjHeMiClHiCoJiDgGiBfLiDfOiCkKiCkAiCoJiPoKiNiH_xHqqkZx_ -----
	{
		// _xZkqqHx_iDiBiDjDiDgPjFmPjAjEiCnGiCmMiDeBiDeOiDfKiDfIiLjGiJmCiBeC_xHqqkZx_
		FCAutoLeaveCriticalSection atlcs(m_pThreadData->m_csAccessMember);
		m_pThreadData->m_pFileDialog = NULL;
		m_pThreadData = NULL;
	}

	// Baseclass_xZkqqHx_iKnGjAjEiOmAiNhDiBeC_xHqqkZx_
	BASE_CLASS::OnDestroy();
} // FCFdbOpenDdFile::OnDestroy.

