// LogView.cpp : ÀÀ¿ë ÇÁ·Î±×·¥¿¡ ´ëÇÑ Å¬·¡½º µ¿ÀÛÀ» Á¤ÀÇÇÕ´Ï´Ù.
|
//
|
|
#include "stdafx.h"
|
#include "LogView.h"
|
#include "MainFrm.h"
|
|
#include "LogViewDoc.h"
|
#include "LogViewView.h"
|
|
#ifdef _DEBUG
|
#define new DEBUG_NEW
|
#endif
|
|
|
// CLogViewApp
|
|
BEGIN_MESSAGE_MAP(CLogViewApp, CWinApp)
|
ON_COMMAND(ID_APP_ABOUT, &CLogViewApp::OnAppAbout)
|
// Ç¥ÁØ ÆÄÀÏÀ» ±âÃÊ·Î ÇÏ´Â ¹®¼ ¸í·ÉÀÔ´Ï´Ù.
|
ON_COMMAND(ID_FILE_NEW, &CWinApp::OnFileNew)
|
ON_COMMAND(ID_FILE_OPEN, &CWinApp::OnFileOpen)
|
END_MESSAGE_MAP()
|
|
|
// CLogViewApp »ý¼º
|
|
CLogViewApp::CLogViewApp()
|
{
|
// TODO: ¿©±â¿¡ »ý¼º Äڵ带 Ãß°¡ÇÕ´Ï´Ù.
|
// InitInstance¿¡ ¸ðµç Áß¿äÇÑ ÃʱâÈ ÀÛ¾÷À» ¹èÄ¡ÇÕ´Ï´Ù.
|
|
m_hMutex = NULL;
|
}
|
|
|
// À¯ÀÏÇÑ CLogViewApp °³Ã¼ÀÔ´Ï´Ù.
|
|
CLogViewApp theApp;
|
|
|
// CLogViewApp ÃʱâÈ
|
|
int CLogViewApp::ExitInstance()
|
{
|
if (m_hMutex)
|
CloseHandle(m_hMutex);
|
|
return CWinApp::ExitInstance();
|
}
|
|
BOOL CLogViewApp::InitInstance()
|
{
|
m_hMutex = CreateMutex(NULL, FALSE, _T("MutexLogViwer"));
|
if (ERROR_ALREADY_EXISTS == GetLastError())
|
{
|
return FALSE;
|
}
|
|
// ÀÀ¿ë ÇÁ·Î±×·¥ ¸Å´ÏÆä½ºÆ®°¡ ComCtl32.dll ¹öÀü 6 ÀÌ»óÀ» »ç¿ëÇÏ¿© ºñÁÖ¾ó ½ºÅ¸ÀÏÀ»
|
// »ç¿ëÇϵµ·Ï ÁöÁ¤ÇÏ´Â °æ¿ì, Windows XP »ó¿¡¼ ¹Ýµå½Ã InitCommonControlsEx()°¡ ÇÊ¿äÇÕ´Ï´Ù.
|
// InitCommonControlsEx()¸¦ »ç¿ëÇÏÁö ¾ÊÀ¸¸é âÀ» ¸¸µé ¼ö ¾ø½À´Ï´Ù.
|
INITCOMMONCONTROLSEX InitCtrls;
|
InitCtrls.dwSize = sizeof(InitCtrls);
|
// ÀÀ¿ë ÇÁ·Î±×·¥¿¡¼ »ç¿ëÇÒ ¸ðµç °ø¿ë ÄÁÆ®·Ñ Ŭ·¡½º¸¦ Æ÷ÇÔÇϵµ·Ï
|
// ÀÌ Ç׸ñÀ» ¼³Á¤ÇϽʽÿÀ.
|
InitCtrls.dwICC = ICC_WIN95_CLASSES;
|
InitCommonControlsEx(&InitCtrls);
|
|
CWinApp::InitInstance();
|
|
// OLE ¶óÀ̺귯¸®¸¦ ÃʱâÈÇÕ´Ï´Ù.
|
if (!AfxOleInit())
|
{
|
AfxMessageBox(IDP_OLE_INIT_FAILED);
|
return FALSE;
|
}
|
AfxEnableControlContainer();
|
// Ç¥ÁØ ÃʱâÈ
|
// ÀÌµé ±â´ÉÀ» »ç¿ëÇÏÁö ¾Ê°í ÃÖÁ¾ ½ÇÇà ÆÄÀÏÀÇ Å©±â¸¦ ÁÙÀÌ·Á¸é
|
// ¾Æ·¡¿¡¼ ÇÊ¿ä ¾ø´Â ƯÁ¤ ÃʱâÈ
|
// ·çƾÀ» Á¦°ÅÇØ¾ß ÇÕ´Ï´Ù.
|
// ÇØ´ç ¼³Á¤ÀÌ ÀúÀåµÈ ·¹Áö½ºÆ®¸® ۸¦ º¯°æÇϽʽÿÀ.
|
// TODO: ÀÌ ¹®ÀÚ¿À» ȸ»ç ¶Ç´Â Á¶Á÷ÀÇ À̸§°ú °°Àº
|
// ÀûÀýÇÑ ³»¿ëÀ¸·Î ¼öÁ¤ÇØ¾ß ÇÕ´Ï´Ù.
|
SetRegistryKey(_T("·ÎÄà ÀÀ¿ë ÇÁ·Î±×·¥ ¸¶¹ý»ç¿¡¼ »ý¼ºµÈ ÀÀ¿ë ÇÁ·Î±×·¥"));
|
LoadStdProfileSettings(4); // MRU¸¦ Æ÷ÇÔÇÏ¿© Ç¥ÁØ INI ÆÄÀÏ ¿É¼ÇÀ» ·ÎµåÇÕ´Ï´Ù.
|
// ÀÀ¿ë ÇÁ·Î±×·¥ÀÇ ¹®¼ ÅÛÇø´À» µî·ÏÇÕ´Ï´Ù. ¹®¼ ÅÛÇø´Àº
|
// ¹®¼, ÇÁ·¹ÀÓ Ã¢ ¹× ºä »çÀÌÀÇ ¿¬°á ¿ªÇÒÀ» ÇÕ´Ï´Ù.
|
CSingleDocTemplate* pDocTemplate;
|
pDocTemplate = new CSingleDocTemplate(
|
IDR_MAINFRAME,
|
RUNTIME_CLASS(CLogViewDoc),
|
RUNTIME_CLASS(CMainFrame), // ÁÖ SDI ÇÁ·¹ÀÓ Ã¢ÀÔ´Ï´Ù.
|
RUNTIME_CLASS(CLogViewView));
|
if (!pDocTemplate)
|
return FALSE;
|
AddDocTemplate(pDocTemplate);
|
|
|
|
// Ç¥ÁØ ¼Ð ¸í·É, DDE, ÆÄÀÏ ¿±â¿¡ ´ëÇÑ ¸í·ÉÁÙÀ» ±¸¹® ºÐ¼®ÇÕ´Ï´Ù.
|
CCommandLineInfo cmdInfo;
|
ParseCommandLine(cmdInfo);
|
|
|
// ¸í·ÉÁÙ¿¡ ÁöÁ¤µÈ ¸í·ÉÀ» µð½ºÆÐÄ¡ÇÕ´Ï´Ù.
|
// ÀÀ¿ë ÇÁ·Î±×·¥ÀÌ /RegServer, /Register, /Unregserver ¶Ç´Â /Unregister·Î ½ÃÀÛµÈ °æ¿ì FALSE¸¦ ¹ÝȯÇÕ´Ï´Ù.
|
if (!ProcessShellCommand(cmdInfo))
|
return FALSE;
|
|
// â Çϳª¸¸ ÃʱâȵǾúÀ¸¹Ç·Î À̸¦ Ç¥½ÃÇÏ°í ¾÷µ¥ÀÌÆ®ÇÕ´Ï´Ù.
|
m_pMainWnd->ShowWindow(SW_SHOW);
|
m_pMainWnd->UpdateWindow();
|
// Á¢¹Ì»ç°¡ ÀÖÀ» °æ¿ì¿¡¸¸ DragAcceptFiles¸¦ È£ÃâÇÕ´Ï´Ù.
|
// SDI ÀÀ¿ë ÇÁ·Î±×·¥¿¡¼´Â ProcessShellCommand ÈÄ¿¡ ÀÌ·¯ÇÑ È£ÃâÀÌ ¹ß»ýÇØ¾ß ÇÕ´Ï´Ù.
|
return TRUE;
|
}
|
|
|
|
// ÀÀ¿ë ÇÁ·Î±×·¥ Á¤º¸¿¡ »ç¿ëµÇ´Â CAboutDlg ´ëÈ »óÀÚÀÔ´Ï´Ù.
|
|
class CAboutDlg : public CDialog
|
{
|
public:
|
CAboutDlg();
|
|
// ´ëÈ »óÀÚ µ¥ÀÌÅÍÀÔ´Ï´Ù.
|
enum { IDD = IDD_ABOUTBOX };
|
|
protected:
|
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV Áö¿øÀÔ´Ï´Ù.
|
|
// ±¸ÇöÀÔ´Ï´Ù.
|
protected:
|
DECLARE_MESSAGE_MAP()
|
};
|
|
CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
|
{
|
}
|
|
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
|
{
|
CDialog::DoDataExchange(pDX);
|
}
|
|
BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
|
END_MESSAGE_MAP()
|
|
// ´ëÈ »óÀÚ¸¦ ½ÇÇàÇϱâ À§ÇÑ ÀÀ¿ë ÇÁ·Î±×·¥ ¸í·ÉÀÔ´Ï´Ù.
|
void CLogViewApp::OnAppAbout()
|
{
|
CAboutDlg aboutDlg;
|
aboutDlg.DoModal();
|
}
|
|
|
// CLogViewApp ¸Þ½ÃÁö 󸮱â
|