ciderpress/mdc/mdc.cpp

65 lines
1.4 KiB
C++
Raw Normal View History

2007-03-27 17:47:10 +00:00
/*
* CiderPress
* Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved.
* See the file LICENSE for distribution terms.
*/
/*
* The application object.
*/
#include "stdafx.h"
#include "mdc.h"
#include "Main.h"
#include <process.h>
/* magic global that MFC finds (or that finds MFC) */
MyApp gMyApp;
DebugLog* gDebugLog;
2007-03-27 17:47:10 +00:00
/*
* Constructor. This is the closest thing to "main" that we have, but we
* should wait for InitInstance for most things.
*/
MyApp::MyApp(LPCTSTR lpszAppName) : CWinApp(lpszAppName)
{
// TODO: make the log file configurable
gDebugLog = new DebugLog(L"C:\\src\\mdclog.txt");
2007-03-27 17:47:10 +00:00
2014-11-18 05:13:13 +00:00
time_t now = time(NULL);
LOGI("MDC v%d.%d.%d started at %.24hs",
kAppMajorVersion, kAppMinorVersion, kAppBugVersion,
ctime(&now));
2007-03-27 17:47:10 +00:00
int tmpDbgFlag;
// enable memory leak detection
2007-03-27 17:47:10 +00:00
tmpDbgFlag = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);
tmpDbgFlag |= _CRTDBG_LEAK_CHECK_DF;
_CrtSetDbgFlag(tmpDbgFlag);
LOGI("Leak detection enabled");
2007-03-27 17:47:10 +00:00
}
/*
* This is the last point of control we have.
*/
MyApp::~MyApp(void)
{
LOGI("MDC shutting down");
delete gDebugLog;
2007-03-27 17:47:10 +00:00
}
/*
* It all begins here.
*
* Create a main window.
*/
BOOL
MyApp::InitInstance(void)
{
m_pMainWnd = new MainWindow;
m_pMainWnd->ShowWindow(m_nCmdShow);
m_pMainWnd->UpdateWindow();
2007-03-27 17:47:10 +00:00
return TRUE;
2007-03-27 17:47:10 +00:00
}