
// DFPGE.cpp : Implementation of CDFPGEApp and DLL registration.

#include "stdafx.h"
#include "DFPGE.h"
#include "Version.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#endif

CDFPGEApp theApp;

const GUID CDECL BASED_CODE _tlid =
		{ 0xFE69BD77, 0x3946, 0x4641, { 0x86, 0x13, 0x6F, 0xC7, 0x14, 0x4F, 0x2E, 0x5 } };
const WORD _wVerMajor = VERSION_MAJOR;
const WORD _wVerMinor = VERSION_MINOR;

// CDFPGEApp::InitInstance - DLL initialization
BOOL CDFPGEApp::InitInstance() {
	BOOL bInit = COleControlModule::InitInstance();
	if (bInit)
	{
		// Initiation code
	}
	return bInit;
}

// CDFPGEApp::ExitInstance - DLL termination
int CDFPGEApp::ExitInstance() {
	return COleControlModule::ExitInstance();
}

// DllRegisterServer - Adds entries to the system registry
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 - Removes entries from the system registry
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;
}
