#define	STRICT
#include	<windows.h>
#include	"kctrl.h"
#include	"controls.h"
#include	"main.h"

HINSTANCE	g_hInst = 0 ;
DWORD		g_dwFontZW = 0 ;
DWORD		g_dwFontHW = 0 ;
DWORD		g_dwFontH = 0 ;

BOOL APIENTRY
DllMain( HINSTANCE hModule, DWORD dwReason, void *lpReserved )
{
	switch ( dwReason ) {
	case DLL_PROCESS_ATTACH:
		g_hInst = hModule ;
		/* KCTRL.DLLの初期化を行う */
		if ( !InitKanjiControls() ) {
			return FALSE ;
		}
		g_dwFontZW = GetFontZW() ;
		g_dwFontHW = GetFontHW() ;
		g_dwFontH  = GetFontH() ;
		/* コントロールの初期化を行う */
		POBoxCtrlRegisterClass( g_hInst ) ;
		ConfirmRegisterClass( g_hInst ) ;
		SoftKeyRegisterClass( g_hInst ) ;
		break ;
	case DLL_PROCESS_DETACH:
		ReleaseKanjiControls() ;
		break ;
	}
	return TRUE ;
}

STDAPI
DllCanUnloadNow()
{
	return MyCanUnloadNow() ;
}

HRESULT PASCAL
DllGetClassObject( REFCLSID clsid, REFIID iid, LPVOID *ppv )
{
	return MyGetClassObject( clsid, iid, ppv ) ;
}

STDAPI
DllRegisterServer()
{
	return S_OK ;
}

STDAPI
DllUnregisterServer()
{
	return S_OK ;
}
