Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

Cyclomatic Complexity Viewer

, 30 Jun 2005
A Cyclomatic complexity viewer application.
ccmetricviewer_dll.zip
Program Files
CCMetricViewer
1033
Resource.dll
CCMetricViewer.dll
ccmetricviewer_src.zip
C++ Programs
CCMetricViewer
AddIn.def
AddIn.rgs
ccmlogo.bmp
logo.bmp
mlogo.bmp
Resource
ccmlogo.bmp
mlogo.bmp
vc6_dll.zip
Microsoft Visual Studio
COMMON
MSDev98
AddIns
CycloComplexViewer.dll
vc6_source.zip
CycloComplexViewer
CycloComplexViewer.clw
CycloComplexViewer.def
CycloComplexViewer.dsp
CycloComplexViewer.dsw
CycloComplexViewer.odl
res
logo.ico
TBarLrge.bmp
TBarMedm.bmp
// CycloComplexViewer.cpp : Legt die Initialisierungsroutinen f�r die DLL fest.
//

#include "stdafx.h"
#include <initguid.h>
#include "CycloComplexViewer.h"
#include "DSAddIn.h"
#include "Commands.h"

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

CComModule _Module;

BEGIN_OBJECT_MAP(ObjectMap)
	OBJECT_ENTRY(CLSID_DSAddIn, CDSAddIn)
END_OBJECT_MAP()

/////////////////////////////////////////////////////////////////////////////
// CCycloComplexViewerApp

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

// �berladungen
	// Vom Klassenassistenten generierte �berladungen virtueller Funktionen
	//{{AFX_VIRTUAL(CCycloComplexViewerApp)
	public:
	virtual BOOL InitInstance();
	virtual int ExitInstance();
	//}}AFX_VIRTUAL

	//{{AFX_MSG(CCycloComplexViewerApp)
		// HINWEIS - An dieser Stelle werden Member-Funktionen vom Klassenassistenten eingef�gt und entfernt..
		//    Innerhalb dieser generierten Quelltextabschnitte NICHTS VER�NDERN!
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};


/////////////////////////////////////////////////////////////////////////////
// CCycloComplexViewerApp

BEGIN_MESSAGE_MAP(CCycloComplexViewerApp, CWinApp)
	//{{AFX_MSG_MAP(CCycloComplexViewerApp)
		// HINWEIS - Hier werden Mapping-Makros vom Klassenassistenten eingef�gt und entfernt.
		//    Innerhalb dieser generierten Quelltextabschnitte NICHTS VER�NDERN!
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// Das einzige CCycloComplexViewerApp-Objekt

CCycloComplexViewerApp theApp;

/////////////////////////////////////////////////////////////////////////////
// CCycloComplexViewerApp Konstruktion

CCycloComplexViewerApp::CCycloComplexViewerApp()
{
	// ZU ERLEDIGEN: Hier Code zur Konstruktion einf�gen
	// Alle wichtigen Initialisierungen in InitInstance platzieren
}

/////////////////////////////////////////////////////////////////////////////
// CCycloComplexViewerApp Initialisierung

BOOL CCycloComplexViewerApp::InitInstance()
{
	_Module.Init(ObjectMap, m_hInstance);
	return CWinApp::InitInstance();
}

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

/////////////////////////////////////////////////////////////////////////////
// Spezielle, f�r Inproc-Server ben�tigte Einsprungpunkte

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;
}

// Sie k�nnen regsvr32.exe verwenden, indem Sie DllRegisterServer exportieren
STDAPI DllRegisterServer(void)
{
	AFX_MANAGE_STATE(AfxGetStaticModuleState());
	HRESULT hRes = S_OK;
	
	// Registriert Objekt, Typelib und alle Schnittstellen in Typelib
	hRes = _Module.RegisterServer(TRUE);
	if (FAILED(hRes))
		return hRes;

	// Beschreibung dieses AddIn-Objekts in seinem eigenen
	//  /Description Teilschl�ssel registrieren.
	// ZU ERLEDIGEN:  Wenn Sie diesem Modul weitere AddIns hinzuf�gen, m�ssen Sie
	//  zur Registrierung all Ihrer Beschreibungen jede Beschreibung
	//  im CLSID-Eintrag der Registrierung jedes Add-In-Objekts registrieren:
	// HKEY_CLASSES_ROOT\Clsid\{add-in  HKEY_CLASSES_ROOT\Clsid\{add-in CLSID}\Description="Add-In-Beschreibung"
	_ATL_OBJMAP_ENTRY* pEntry = _Module.m_pObjMap;
	CRegKey key;
	LONG lRes = key.Open(HKEY_CLASSES_ROOT, _T("CLSID"));
	if (lRes == ERROR_SUCCESS)
	{
		USES_CONVERSION;
		LPOLESTR lpOleStr;
		StringFromCLSID(*pEntry->pclsid, &lpOleStr);
		LPTSTR lpsz = OLE2T(lpOleStr);

		lRes = key.Open(key, lpsz);
		if (lRes == ERROR_SUCCESS)
		{
			CString strDescription;
			strDescription.LoadString(IDS_CYCLOCOMPLEXVIEWER_DESCRIPTION);
			key.SetKeyValue(_T("Description"), strDescription);
		}
		CoTaskMemFree(lpOleStr);
	}
	if (lRes != ERROR_SUCCESS)
		hRes = HRESULT_FROM_WIN32(lRes);

	return hRes;
}

/////////////////////////////////////////////////////////////////////////////
// DllUnregisterServer - Entfernt Eintr�ge aus der Systemregistrierung

STDAPI DllUnregisterServer(void)
{
	AFX_MANAGE_STATE(AfxGetStaticModuleState());

	HRESULT hRes = S_OK;
	_Module.UnregisterServer();
	return hRes;
}


/////////////////////////////////////////////////////////////////////////////
// Testlauf-Unterst�tzung

// GetLastErrorDescription wird in der Implementierung des Makros VERIFY_OK
//  verwendet, das in stdafx.h definiert ist.

#ifdef _DEBUG

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

#endif //_DEBUG

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

Franz Klein

United Kingdom United Kingdom
I am a qualified Veterinary Surgeon who prefers treating computers with viruses than animals with viruses. I have recently completed a MEng German Informatics degree at the University of Reading with a 2:1. I also have the ISEB Foundation Certificate in Software Testing.
 
Currently I am umemployed and desparately looking for a job in the IT industry.

| Advertise | Privacy | Mobile
Web03 | 2.8.140821.2 | Last Updated 1 Jul 2005
Article Copyright 2005 by Franz Klein
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid