// MyOcx.cpp : CMyOcxApp および DLL 登録の実装

#include "stdafx.h"
#include "MyOcx.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#endif


CMyOcxApp NEAR theApp;

const GUID CDECL BASED_CODE _tlid =
		{ 0x78325401, 0x8898, 0x4777, { 0xBF, 0xF, 0x75, 0xBC, 0xE0, 0xA4, 0x7, 0x19 } };
const WORD _wVerMajor = 1;
const WORD _wVerMinor = 0;



// CMyOcxApp::InitInstance - DLL 初期化

BOOL CMyOcxApp::InitInstance()
{
	BOOL bInit = COleControlModule::InitInstance();

	if (bInit)
	{
		// TODO: この位置にモジュールの初期化処理コードを追加してください。
	}

	return bInit;
}



// CMyOcxApp::ExitInstance - DLL 終了

int CMyOcxApp::ExitInstance()
{
	// TODO: この位置にモジュールの終了処理を追加してください。

	return COleControlModule::ExitInstance();
}



// DllRegisterServer - エントリをシステム レジストリに追加します。

STDAPI DllRegisterServer(void)
{
	AFX_MANAGE_STATE(_afxModuleAddrThis);

	if (!AfxOleRegisterTypeLib(AfxGetInstanceHandle(), _tlid))
		return ResultFromScode(SELFREG_E_TYPELIB);

	if (!COleObjectFactoryEx::UpdateRegistryAll(TRUE))
		return ResultFromScode(SELFREG_E_CLASS);

	return NOERROR;
}



// DllUnregisterServer - エントリをレジストリから削除します。
//

STDAPI DllUnregisterServer(void)
{
	AFX_MANAGE_STATE(_afxModuleAddrThis);

	if (!AfxOleUnregisterTypeLib(_tlid, _wVerMajor, _wVerMinor))
		return ResultFromScode(SELFREG_E_TYPELIB);

	if (!COleObjectFactoryEx::UpdateRegistryAll(FALSE))
		return ResultFromScode(SELFREG_E_CLASS);

	return NOERROR;
}

