#ifndef __MpgExtern_cpp
#define __MpgExtern_cpp

#ifndef _MPG_EXT_MFC6_0
//----- MFC6.0 _xZkqqHx_iCmMiKgHjCkD_xHqqkZx_DLL _xZkqqHx_iCpAiOgHiCoNiCmIiCkCiPoKiNiH_xHqqkZx_ -----

// MfcString _xZkqqHx_iCmMiDfCiBfLiDgIiCpAiDeDiDjDiDeOiDiLiBfLiDgIiBeC_xHqqkZx_
// MFcString _xZkqqHx_iCmNiBeBiDhGiDiJiDePiDeDiDjDjCiGiCmFiDeDiDjDiDfIiDfOiDjDiDfIiNoMjAkMiCmFiCkLiCoJiCoGiCkEiCmJ_xHqqkZx_
// _xZkqqHx_iDfCiDjDiDfIiDgHiDiJiDeOiDfOjDjJiCpAjHhAiInDiBeC_xHqqkZx_
#include "MFC/MfcString.cpp"
// MFC_xZkqqHx_iCmMiDfCiBfLiDgIiCpAiDeDiDjDiDeOiDiLiBfLiDgIiBeC_xHqqkZx_
#include "MFC/MfcWnd.cpp"
#include "MFC/MfcDC.cpp"
#include "MFC/MfcGdiObject.cpp"
#include "MFC/MfcBrush.cpp"
#include "MFC/MfcFont.cpp"
#include "MFC/MfcPalette.cpp"
#include "MFC/MfcPen.cpp"
#include "MFC/MfcRgn.cpp"
#include "MFC/MfcBitmap.cpp"
#include "MFC/MfcWaitCursor.cpp"

/*************************************************************************
 * <_xZkqqHx_iJiJiOfKiOhB_xHqqkZx_>	new
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDiBiDiCiDiKiBfLiCpAiKiEiCoIjDjGiCmEiCoJiBeC_xHqqkZx_DynamicDraw_xZkqqHx_jGhLjBmMiCmMjHmMiIoGiCpAiOoGjDlOiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	06.03.17 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void* mpg_sdk::operator new (size_t nSize)
{
// 06.03.18 Fukushiro M. 1_xZkqqHx_iNhDjFmPiNfI_xHqqkZx_ ()
//	return FMpgGetComponent0MolipMainI()->Allocate(nSize);
	return FMpgGetModule()->Allocate(nSize);
}

/*************************************************************************
 * <_xZkqqHx_iJiJiOfKiOhB_xHqqkZx_>	delete
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDiBiDiCiDiKiBfLiCpAiNoNiPjMiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	06.03.17 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void mpg_sdk::operator delete (void* p)
{
// 06.03.18 Fukushiro M. 1_xZkqqHx_iNhDjFmPiNfI_xHqqkZx_ ()
//	FMpgGetComponent0MolipMainI()->Free(p);
	FMpgGetModule()->Free(p);
}

#endif //_MPG_EXT_MFC6_0

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FMpgGetModule
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDhGiDiJiDePiDeDiDjDiCmMiDiCiDfHiDiFiBfLiDiLiCpAiNoMjAkMiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iJpAjAoA_xHqqkZx_>	template_xZkqqHx_iKnGjAjEiCmFjCpBiLjPiClFiCmEiCkCiClNiCkKiBeB_xHqqkZx_VC_xZkqqHx_iCmMiDgPiBfLiDfHiDiHiDjDiCkK_xHqqkZx_UP_xZkqqHx_iClFiClNiCoH_xHqqkZx_
 *			_xZkqqHx_jFkBjAjEiCmMiDgFiDjDiDhGiDiMiBfLiDgHiOmAjBmMiCkKiNoMjAkMiClDiCoKiCoJiCoGiCkEiCmJiCmIiCmBiClNiClNiCnPiBeBiClBiClBiCmJiInKjDkOiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	06.03.17 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
CMpgModule* FMpgGetModule ()
{
	static CMpgModule s_module;
	return &s_module;
} // FMpgGetModule.

/*************************************************************************
 * <_xZkqqHx_iJpAjAoA_xHqqkZx_>	_xZkqqHx_iDfCiDjDiDhMiBfLiDgMiDjDiDgHiCmMiDeDiDjDiDfIiDfOiDjDiDfIiDeKiDeFiDjDiDfOiBeC_xHqqkZx_
 *			_xZkqqHx_iDiCiDfHiDiFiBfLiDiLjCiGiCmJiCkCiCkNiCmCiDfCiDjDiDhMiBfLiDgMiDjDiDgHiDeDiDjDiDfIiDfOiDjDiDfIiCkKiCkAiCoJiCkJiCpA_xHqqkZx_
 *			_xZkqqHx_iDeKiDeFiDjDiDgHiClHiCoJiBeC_xHqqkZx_
 *			_xZkqqHx_iClBiCmMjCgMiCkKiCePiCmJiCmIiCmBiClNiCmGiCkLiCmJiDiCiDfHiDiFiBfLiDiLiCmNiJpAjFpKiCmFiCkLiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	06.03.17 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
long IMpgInterface::s_cComponents = 0;

///////////////////////////////////////////////////////////////////////////
// DLL_xZkqqHx_iMpGiKeKiKnGjAjEiBeC_xHqqkZx_

// _xZkqqHx_iDhGiDiJiDePiDeDiDjDjCiGiCmFiDiGiBfLiDfFiBfLiCkKiDeHiDeOiDfIiDhMiBfLiDgHiKnGjAjEiCpAjCoIiLgAiClHiCoJiPoKiNiHiCmNiBeB_xHqqkZx_
// _USER_DEFINE_EXPORT _xZkqqHx_iCpA_xHqqkZx_ define _xZkqqHx_iClHiCoJiBeC_xHqqkZx_

#ifndef _USER_DEFINE_EXPORT

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	DllMolipSupportInfo
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	DLL_xZkqqHx_iCmMiDfEiDhMiBfLiDgHiPoOjFpBiCpAiOoGjDlOiClHiCoJiBeC_xH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kZx_
 *			wcpModuleName	:_xZkqqHx_iDhGiDiJiDePiDeDiDjDiCmMiDiCiDfHiDiFiBfLiDiLjGlMiCpAjFnEiClHiBeC_xHqqkZx_
 *			wcpSupportInfo	:_xZkqqHx_iDhGiDiJiDePiDeDiDjDiCmMjDpMiOoIjAoGjDjJiBeBiDfEiDhMiBfLiDgHiPoOjFpBiCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_jAkMiMpHiClFiClNiPoKiNiHiCmN_xHqqkZx_S_OK_xZkqqHx_iBeBiOlIjEhDiCmIiCoHiCmO_xHqqkZx_S_FALSE_xZkqqHx_iBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.05.16 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
STDAPI DllMolipSupportInfo (WORD* wSupportApp,
							WORD* wAppVersion,
							const wchar_t** wcpIsUnicode,
							LANGID** pLangId,
							const wchar_t** wcpModuleName,
							const wchar_t** wcpSupportInfo)
{
	union FCAppVersion
	{
		WORD	wVersion;	// _xZkqqHx_iDeBiDhGiDiKiDgPiBfLiDfHiDiHiDjDiBeC_xHqqkZx_
		struct {
			WORD	wLevelB	: 2;	// _xZkqqHx_iDiMiDhIiDiLiCgBiBeC_xHqqkZx_
			WORD	wLevelA	: 4;	// _xZkqqHx_iDiMiDhIiDiLiCgAiBeC_xHqqkZx_
			WORD	wMinor	: 5;	// _xZkqqHx_iDhNiDeDiDgJiBfLiDgPiBfLiDfHiDiHiDjDiBeC_xHqqkZx_
			WORD	wMajor	: 5;	// _xZkqqHx_iDiBiDfHiDiDiBfLiDgPiBfLiDfHiDiHiDjDiBeC_xHqqkZx_
		};
	} ver;
	ver.wMajor = FD_APP_MAJOR_VER;
	ver.wMinor = FD_APP_MINOR_VER;
// 06.06.30 Fukushiro M. 1_xZkqqHx_iNhDjFmPiNfI_xHqqkZx_ ()
//	ver.wLevelA = FD_APP_LEVEL_A - 'A';
	ver.wLevelA = FD_APP_LEVEL_A - 'K';
	ver.wLevelB = FD_APP_LEVEL_B - '1';

	if (wSupportApp != NULL)
		*wSupportApp = PG_MODULE_APP;
	if (wAppVersion != NULL)
		*wAppVersion = ver.wVersion;
//----- 06.05.02 Fukushiro M. _xZkqqHx_jCmHiJmBiOgO_xHqqkZx_ ()-----
	if (wcpIsUnicode != NULL)
		*wcpIsUnicode = FD_APP_IS_UNICODE;
//----- 06.05.02 Fukushiro M. _xZkqqHx_jCmHiJmBiPeJ_xHqqkZx_ ()-----

//----- 06.04.22 Fukushiro M. _xZkqqHx_jCmHiJmBiOgO_xHqqkZx_ ()-----
	if (pLangId != NULL)
		*pLangId = PG_MODULE_SUPPORT_LANG;
//----- 06.04.22 Fukushiro M. _xZkqqHx_jCmHiJmBiPeJ_xHqqkZx_ ()-----
	if (wcpModuleName != NULL)
		*wcpModuleName = PG_MODULE_NAME;
	if (wcpSupportInfo != NULL)
		*wcpSupportInfo = PG_MODULE_SUPPORT_INFO;
	return S_OK;
} // DllMolipSupportInfo.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	DllMolipInitialize
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	DLL_xZkqqHx_iCpAiPiJiKpKiJlLiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	pfnAllocate	:_xZkqqHx_iDiBiDiCiDiKiBfL_xHqqkZx_Allocate_xZkqqHx_iKnGjAjEiCpAiOhHjCoIiBeC_xHqqkZx_
 *			pfnFree		:_xZkqqHx_iDiBiDiCiDiKiBfL_xHqqkZx_Free_xZkqqHx_iKnGjAjEiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_jAkMiMpHiClFiClNiPoKiNiHiCmN_xHqqkZx_S_OK_xZkqqHx_iBeBiOlIjEhDiCmIiCoHiCmO_xHqqkZx_S_FALSE_xZkqqHx_iBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.05.16 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
STDAPI DllMolipInitialize (	FuncAllocate pfnAllocate,	// _xZkqqHx_iDiBiDiCiDiKiBfL_xHqqkZx_Allocate_xZkqqHx_iKnGjAjEiBeC_xHqqkZx_
							FuncFree pfnFree,			// _xZkqqHx_iDiBiDiCiDiKiBfL_xHqqkZx_Free_xZkqqHx_iKnGjAjEiBeC_xHqqkZx_
							IMpgMolipBase* pI)			// DynamicDraw_xZkqqHx_jGhLjBmMiDeDiDjDiDfOiDhEiDeGiBfLiDfIiBeC_xHqqkZx_
{
	return FMpgGetModule()->MolipInitialize(pfnAllocate, pfnFree, pI);
} // DllMolipInitialize.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	DllMolipTerminate
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	DLL_xZkqqHx_iCpAiPeJjHlJiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_jAkMiMpHiClFiClNiPoKiNiHiCmN_xHqqkZx_S_OK_xZkqqHx_iBeBiOlIjEhDiCmIiCoHiCmO_xHqqkZx_S_FALSE_xZkqqHx_iBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.05.16 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
STDAPI DllMolipTerminate ()
{
	return FMpgGetModule()->MolipTerminate();
} // DllMolipTerminate.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	DllCanUnloadNow
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iClBiCmM_xHqqkZx_DLL_xZkqqHx_iCkKiJpAjFpKiJmCjEfMiCkJiCmHiCkEiCkJiCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iJpAjFpKiJmCjEfMiCmIiCoHiCmO_xHqqkZx_ S_OK_xZkqqHx_iBeBjFhDiJmCiCmIiCoHiCmO_xHqqkZx_S_FALSE_xZkqqHx_iBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	01.08.02 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
STDAPI DllCanUnloadNow ()
{
	return FMpgGetModule()->CanUnloadNow();
} // DllCanUnloadNow.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	DllMolipGetClassObject
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iOhHjCoIiClDiCoKiClNiDeDiDjDiDgGiDgCiDeOiDfIiCmMiDfCiDjDiDhMiBfLiDgMiDjDiDgHiCmMiDeDiDjDiDfOiDhEiDeGiBfLiDfIiCpA_xHqqkZx_
 *			_xZkqqHx_iNoMjAkMiClFiCmEjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	idxCompo:_xZkqqHx_iDfCiDjDiDhMiBfLiDgMiDjDiDgHiDeDiDjDiDgGiDgCiDeOiDfIiCpAiOhHjCoIiBeC_xHqqkZx_
 *			iid		:_xZkqqHx_iDeDiDjDiDfOiDhEiDeGiBfLiDfIiCpAiOhHjCoIiBeC_xHqqkZx_
 *			ppv		:_xZkqqHx_iDeDiDjDiDfOiDhEiDeGiBfLiDfIiCpAiOpDiCkPiOoGiCoJjFmPjAjEiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_jAkMiMpHiClFiClNiPoKiNiHiCmN_xHqqkZx_ S_OK_xZkqqHx_iBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	01.08.02 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
STDAPI DllMolipGetClassObject (int idxCompo, const IID& iid, void** ppv)
{
	return FMpgGetModule()->MolipGetClassObject(idxCompo, iid, ppv);
} // DllMolipGetClassObject.

///////////////////////////////////////////////////////////////////////////
// regsvr32.exe _xZkqqHx_iCkJiCoHiOmAiNhDiClDiCoKiCoJiMpGiKeKiKnGjAjEiBeC_xHqqkZx_

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	DllRegisterServer
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iClBiCmM_xHqqkZx_DLL_xZkqqHx_iCmMjDgPjIfOiCpAiNhDiCkEiBeC_xHqqkZx_regsvr32.exe_xZkqqHx_iCmJiCoGiCoJiDeDiDjDiDfIiDgHiBfLiDiLiOjOiCmJ_xHqqkZx_
 *			_xZkqqHx_iOmAiNhDiClDiCoKiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	01.08.02 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
STDAPI DllRegisterServer ()
{
	return FMpgGetModule()->RegisterServer(PG_MODULE_CLSID, PG_MODULE_NAME, PG_MODULE_APP);
} // DllRegisterServer.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	DllUnregisterServer
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iClBiCmM_xHqqkZx_DLL_xZkqqHx_iCmMjDgPjIfOiCpAjGjFiPmBiClHiCoJiBeC_xHqqkZx_regsvr32.exe_xZkqqHx_iCmJiCoGiCoJiDeBiDjDiDeDiDjDiDfIiDgHiBfLiDiLiOjOiCmJ_xHqqkZx_
 *			_xZkqqHx_iOmAiNhDiClDiCoKiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	01.08.02 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
STDAPI DllUnregisterServer ()
{
	return FMpgGetModule()->UnregisterServer(PG_MODULE_CLSID);
} // DllUnregisterServer.

#endif //_USER_DEFINE_EXPORT

#endif//__MpgExtern_cpp
