// ExcelMng.cpp : ÀÀ¿ë ÇÁ·Î±×·¥¿¡ ´ëÇÑ Å¬·¡½º µ¿ÀÛÀ» Á¤ÀÇÇÕ´Ï´Ù. // #include "stdafx.h" #include "ExcelMng.h" #include "ExcelMngDlg.h" #ifdef _DEBUG #define new DEBUG_NEW #endif // CExcelMngApp BEGIN_MESSAGE_MAP(CExcelMngApp, CWinApp) ON_COMMAND(ID_HELP, CWinApp::OnHelp) END_MESSAGE_MAP() // CExcelMngApp »ý¼º CExcelMngApp::CExcelMngApp() { // TODO: ¿©±â¿¡ »ý¼º Äڵ带 Ãß°¡ÇÕ´Ï´Ù. // InitInstance¿¡ ¸ðµç Áß¿äÇÑ ÃʱâÈ­ ÀÛ¾÷À» ¹èÄ¡ÇÕ´Ï´Ù. } // À¯ÀÏÇÑ CExcelMngApp °³Ã¼ÀÔ´Ï´Ù. CExcelMngApp theApp; const GUID CDECL BASED_CODE _tlid = { 0x564B64F4, 0x5FA0, 0x47F1, { 0xA1, 0x65, 0xCB, 0xE1, 0xEA, 0x62, 0x75, 0xD5 } }; const WORD _wVerMajor = 1; const WORD _wVerMinor = 0; // CExcelMngApp ÃʱâÈ­ BOOL CExcelMngApp::InitInstance() { // ÀÀ¿ë ÇÁ·Î±×·¥ ¸Å´ÏÆä½ºÆ®°¡ ComCtl32.dll ¹öÀü 6 ÀÌ»óÀ» »ç¿ëÇÏ¿© ºñÁÖ¾ó ½ºÅ¸ÀÏÀ» // »ç¿ëÇϵµ·Ï ÁöÁ¤ÇÏ´Â °æ¿ì, Windows XP »ó¿¡¼­ ¹Ýµå½Ã InitCommonControls()°¡ ÇÊ¿äÇÕ´Ï´Ù. // InitCommonControls()¸¦ »ç¿ëÇÏÁö ¾ÊÀ¸¸é âÀ» ¸¸µé ¼ö ¾ø½À´Ï´Ù. InitCommonControls(); CWinApp::InitInstance(); // OLE ¶óÀ̺귯¸®¸¦ ÃʱâÈ­ÇÕ´Ï´Ù. if (!AfxOleInit()) { AfxMessageBox(IDP_OLE_INIT_FAILED); return FALSE; } AfxEnableControlContainer(); // Ç¥ÁØ ÃʱâÈ­ // ÀÌµé ±â´ÉÀ» »ç¿ëÇÏÁö ¾Ê°í ÃÖÁ¾ ½ÇÇà ÆÄÀÏÀÇ Å©±â¸¦ ÁÙÀÌ·Á¸é // ¾Æ·¡¿¡¼­ ÇÊ¿ä ¾ø´Â ƯÁ¤ ÃʱâÈ­ ·çƾÀ» Á¦°ÅÇØ¾ß ÇÕ´Ï´Ù. // ÇØ´ç ¼³Á¤ÀÌ ÀúÀåµÈ ·¹Áö½ºÆ®¸® ۸¦ º¯°æÇϽʽÿÀ. // TODO: ÀÌ ¹®ÀÚ¿­À» ȸ»ç ¶Ç´Â Á¶Á÷ÀÇ À̸§°ú °°Àº // ÀûÀýÇÑ ³»¿ëÀ¸·Î ¼öÁ¤ÇØ¾ß ÇÕ´Ï´Ù. SetRegistryKey(_T("·ÎÄà ÀÀ¿ë ÇÁ·Î±×·¥ ¸¶¹ý»ç¿¡¼­ »ý¼ºÇÑ ÀÀ¿ë ÇÁ·Î±×·¥")); // ÀÚµ¿È­ ¶Ç´Â reg/unreg ½ºÀ§Ä¡¿¡ ´ëÇÑ ¸í·ÉÁÙÀ» ±¸¹® ºÐ¼®ÇÕ´Ï´Ù. CCommandLineInfo cmdInfo; ParseCommandLine(cmdInfo); // ÀÀ¿ë ÇÁ·Î±×·¥ÀÌ /Embedding ¶Ç´Â /Automation ½ºÀ§Ä¡·Î ½ÃÀ۵Ǿú½À´Ï´Ù. // ÀÀ¿ë ÇÁ·Î±×·¥À» ÀÚµ¿È­ ¼­¹ö·Î ½ÇÇàÇÕ´Ï´Ù. if (cmdInfo.m_bRunEmbedded || cmdInfo.m_bRunAutomated) { // CoRegisterClassObject()¸¦ ÅëÇØ Ŭ·¡½º ÆÑÅ͸®¸¦ µî·ÏÇÕ´Ï´Ù. COleTemplateServer::RegisterAll(); } // ÀÀ¿ë ÇÁ·Î±×·¥ÀÌ /Unregserver ¶Ç´Â /Unregister ½ºÀ§Ä¡·Î ½ÃÀ۵Ǿú½À´Ï´Ù. ·¹Áö½ºÆ®¸®¿¡¼­ Ç׸ñÀ» // Á¦°ÅÇÕ´Ï´Ù. else if (cmdInfo.m_nShellCommand == CCommandLineInfo::AppUnregister) { COleObjectFactory::UpdateRegistryAll(FALSE); AfxOleUnregisterTypeLib(_tlid, _wVerMajor, _wVerMinor); return FALSE; } // ÀÀ¿ë ÇÁ·Î±×·¥ÀÌ µ¶¸³ ½ÇÇàÇüÀ¸·Î ½ÃÀ۵Ǿú°Å³ª ´Ù¸¥ ½ºÀ§Ä¡·Î ½ÃÀ۵Ǿú½À´Ï´Ù(¿¹: /Register // ¶Ç´Â /Regserver). typelibrary¸¦ Æ÷ÇÔÇÏ¿© ·¹Áö½ºÆ®¸® Ç׸ñÀ» ¾÷µ¥ÀÌÆ®ÇÕ´Ï´Ù. else { COleObjectFactory::UpdateRegistryAll(); AfxOleRegisterTypeLib(AfxGetInstanceHandle(), _tlid); if (cmdInfo.m_nShellCommand == CCommandLineInfo::AppRegister) return FALSE; } CExcelMngDlg dlg; m_pMainWnd = &dlg; INT_PTR nResponse = dlg.DoModal(); if (nResponse == IDOK) { // TODO: ¿©±â¿¡ ´ëÈ­ »óÀÚ°¡ È®ÀÎÀ» ´­·¯ ¾ø¾îÁö´Â °æ¿ì ó¸®ÇÒ // Äڵ带 ¹èÄ¡ÇÕ´Ï´Ù. } else if (nResponse == IDCANCEL) { // TODO: ¿©±â¿¡ ´ëÈ­ »óÀÚ°¡ Ãë¼Ò¸¦ ´­·¯ ¾ø¾îÁö´Â °æ¿ì ó¸®ÇÒ // Äڵ带 ¹èÄ¡ÇÕ´Ï´Ù. } // ´ëÈ­ »óÀÚ°¡ ´ÝÇûÀ¸¹Ç·Î ÀÀ¿ë ÇÁ·Î±×·¥ÀÇ ¸Þ½ÃÁö ÆßÇÁ¸¦ ½ÃÀÛÇÏÁö ¾Ê°í // ÀÀ¿ë ÇÁ·Î±×·¥À» ³¡³¾ ¼ö ÀÖµµ·Ï FALSE¸¦ ¹ÝȯÇÕ´Ï´Ù. return FALSE; }