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

Catch All Bugs with BugTrap!

, 31 Jan 2009
A tool that can catch unhandled errors and exceptions, and deliver error reports to remote support servers.
bugtrap_demoapplication.zip
BugTrap Demo Application
BugTrap.dll
BugTrapTest.exe
dbghelp.dll
BugTrap_Documentation.zip
BugTrap_Setup.zip
bugtrap_sourcecode.zip
BugTrap_SourceCode
doc
BugTrap.doc
BugTrap.pdf
Drawing.vsd
Server
BugTrapServer
BugTrapServer.csproj.user
BugTrapServer.nrproj
Properties
Resources
Bug.ico
Services
Web References
BugTrapWebServer
BugTrapWebServer.nrproj
Source
App_Code
Global.asax
ConfigTemplates
JBugTrapServer
BugTrapServer
JBugTrapServer.pg
JBugTrapServer.prj
manifest.mf
Setup
Bug.ico
BugTrap Support Web Site.url
BugTrapSetup.iss
DoNothing.exe
DoNothing.rar
MSXML4
msxml4.dll
msxml4.inf
msxml4a.dll
msxml4r.dll
Win32
BugTrap
BugTrap.aqt
BugTrap.cfg
BugTrap.def
BugTrap.vcproj.MONSTER.Max.user
BugTrap.vcproj.VIRGO.Max.user
CompleteBugTrap.cfg
res
Bug.ico
Checkmark.bmp
ImageToolbar.bmp
SortArrows.bmp
Upload.avi
CrashExplorer
CrashExplorer.cfg
CrashExplorer.vcproj.MONSTER.Max.user
CrashExplorer.vcproj.VIRGO.Max.user
res
Bug.ico
Test.rar
Examples
BugTrapConsoleTest
BugTrapConsoleTest.vcproj.MONSTER.Max.user
BugTrapConsoleTest.vcproj.VIRGO.Max.user
BugTrapNetTest
app.exe.manifest
BugTrapNetTest.csproj.user
Properties
Settings.settings
BugTrapTest
BugTrapTest.vcproj.MONSTER.Max.user
BugTrapTest.vcproj.VIRGO.Max.user
res
BugTrapTest.ico
BugTrapTestDoc.ico
Toolbar.bmp
/*
 * This is a part of the BugTrap package.
 * Copyright (c) 2005-2007 IntelleSoft.
 * All rights reserved.
 *
 * Description: Application entry point.
 * Author: Maksim Pyatkovskiy.
 *
 * This source code is only intended as a supplement to the
 * BugTrap package reference and related electronic documentation
 * provided with the product. See these sources for detailed
 * information regarding the BugTrap package.
 */

#include "stdafx.h"
#include "resource.h"

#include "AboutDlg.h"
#include "MainDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#endif

/// Application object.
CAppModule _Module;

/**
 * @brief Displays main dialog and starts main event loop.
 * @param pszCmdLine - application command line.
 * @param nCmdShow - specifies how the window is to be shown.
 */
int Run(PTSTR pszCmdLine = NULL, int nCmdShow = SW_SHOWDEFAULT)
{
	pszCmdLine;
	CMessageLoop theLoop;
	_Module.AddMessageLoop(&theLoop);

	CMainDlg dlgMain;

	if (dlgMain.Create(NULL) == NULL)
	{
		ATLTRACE(_T("Main dialog creation failed!\n"));
		return 0;
	}

	dlgMain.ShowWindow(nCmdShow);
	int nRet = theLoop.Run();
	_Module.RemoveMessageLoop();

	return nRet;
}

/**
 * @brief Application entry point.
 * @param hInstance - Handle to the current instance of the application.
 * @param hPrevInstance - Handle to the previous instance of the application. This parameter is always NULL.
 * @param pszCmdLine - Pointer to a null-terminated string specifying the command line for the application, excluding the program name.
 * @param nCmdShow - Specifies how the window is to be shown.
 */
int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, PTSTR pszCmdLine, int nCmdShow)
{
#ifdef _CRTDBG_MAP_ALLOC
	// Watch for memory leaks.
	_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_CHECK_ALWAYS_DF | _CRTDBG_LEAK_CHECK_DF);
#endif

	HRESULT hRes = OleInitialize(NULL);
	ATLASSERT(SUCCEEDED(hRes));

	// This resolves ATL window thunking problem when Microsoft Layer for Unicode (MSLU) is used.
	::DefWindowProc(NULL, 0, 0, 0L);

	AtlInitCommonControls(ICC_LISTVIEW_CLASSES | ICC_BAR_CLASSES);	// Add flags to support other controls.

	hRes = _Module.Init(NULL, hInstance);
	ATLASSERT(SUCCEEDED(hRes));

	int nRet = Run(pszCmdLine, nCmdShow);

	_Module.Term();
	OleUninitialize();

	return nRet;
}

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, along with any associated source code and files, is licensed under The Microsoft Public License (Ms-PL)

Share

About the Author

Maksim Pyatkovskiy

United States United States
No Biography provided

| Advertise | Privacy | Mobile
Web04 | 2.8.140827.1 | Last Updated 31 Jan 2009
Article Copyright 2006 by Maksim Pyatkovskiy
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid