⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 spelly.cpp

📁 语法检查程序
💻 CPP
字号:
/***************************************************************************/
/* NOTE:                                                                   */
/* This document is copyright (c) by Oz Solomon and Yonat Sharon, and is   */
/* bound by the MIT open source license.                                   */ 
/* See License.txt or visit www.opensource.org/licenses/mit-license.html   */
/***************************************************************************/

// Spelly.cpp : Defines the initialization routines for the DLL.
//

#include "stdafx.h"

#if DOT_NET_ADDIN
#include "Addin.h"
#include "Connect.h"
#else
#include <initguid.h>
#include "Spelly.h"
#include "DSAddIn.h"
#include "Commands.h"
#endif
#include "Config.h"

#define REG_KEY_BASE    "WndTabs.com\\Spelly"
#define REG_VERSION     "3.0"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

CComModule _Module;

BEGIN_OBJECT_MAP(ObjectMap)
#if DOT_NET_ADDIN
	OBJECT_ENTRY(__uuidof(Connect), CConnect)
#else
	OBJECT_ENTRY(CLSID_DSAddIn, CDSAddIn)
#endif
END_OBJECT_MAP()

/////////////////////////////////////////////////////////////////////////////
// CSpellyApp

class CSpellyApp : public CWinApp
{
public:
	CSpellyApp();

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CSpellyApp)
	public:
	virtual BOOL InitInstance();
	virtual int ExitInstance();
	//}}AFX_VIRTUAL

	//{{AFX_MSG(CSpellyApp)
		// NOTE - the ClassWizard will add and remove member functions here.
		//    DO NOT EDIT what you see in these blocks of generated code !
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};


/////////////////////////////////////////////////////////////////////////////
// CSpellyApp

BEGIN_MESSAGE_MAP(CSpellyApp, CWinApp)
	//{{AFX_MSG_MAP(CSpellyApp)
		// NOTE - the ClassWizard will add and remove mapping macros here.
		//    DO NOT EDIT what you see in these blocks of generated code!
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// The one and only CSpellyApp object

CSpellyApp theApp;

/////////////////////////////////////////////////////////////////////////////
// CSpellyApp construction

CSpellyApp::CSpellyApp()
{
}

/////////////////////////////////////////////////////////////////////////////
// CSpellyApp initialization

BOOL CSpellyApp::InitInstance()
{
    SetRegistryKey(REG_KEY_BASE);
    const char *sVerForReg = REG_VERSION;
    ASSERT(strlen(m_pszProfileName) > strlen(sVerForReg));
    strcpy((char *)m_pszProfileName, sVerForReg);

    _Module.Init(ObjectMap, m_hInstance);
    GetConfiguration();
	return CWinApp::InitInstance();
}

int CSpellyApp::ExitInstance()
{
    WriteConfiguration();
	_Module.Term();
	return CWinApp::ExitInstance();
}

/////////////////////////////////////////////////////////////////////////////
// Special entry points required for inproc servers

STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
{
	AFX_MANAGE_STATE(AfxGetStaticModuleState());
	return _Module.GetClassObject(rclsid, riid, ppv);
}

STDAPI DllCanUnloadNow(void)
{
	AFX_MANAGE_STATE(AfxGetStaticModuleState());
	return (AfxDllCanUnloadNow()==S_OK && _Module.GetLockCount()==0) ? S_OK : S_FALSE;
}

// by exporting DllRegisterServer, you can use regsvr32.exe
STDAPI DllRegisterServer(void)
{
	AFX_MANAGE_STATE(AfxGetStaticModuleState());
    HRESULT hr = _Module.RegisterServer(TRUE);
    
#if !DOT_NET_ADDIN
    if (SUCCEEDED(hr))
    {
        // clean up some registry info from previous versions
        RegDeleteKey(HKEY_CURRENT_USER, 
            "Software\\Microsoft\\DevStudio\\5.0\\AddIns\\Spelly 2.5");
        RegDeleteKey(HKEY_CURRENT_USER, 
            "Software\\Microsoft\\DevStudio\\6.0\\AddIns\\Spelly 2.5");
        cfg_sInitedEnvs = "";
    }
#endif

    return hr;
}

/////////////////////////////////////////////////////////////////////////////
// DllUnregisterServer - Removes entries from the system registry

STDAPI DllUnregisterServer(void)
{
	AFX_MANAGE_STATE(AfxGetStaticModuleState());
	return _Module.UnregisterServer();
}


/////////////////////////////////////////////////////////////////////////////
// Debugging support

// GetLastErrorDescription is used in the implementation of the VERIFY_OK
//  macro, defined in stdafx.h.

#ifdef _DEBUG

void GetLastErrorDescription(CComBSTR& bstr)
{
	CComPtr<IErrorInfo> pErrorInfo;
	if (GetErrorInfo(0, &pErrorInfo) == S_OK)
		pErrorInfo->GetDescription(&bstr);
}

#endif //_DEBUG

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -