Click here to Skip to main content
12,292,669 members (68,759 online)
Click here to Skip to main content


29 bookmarked

Debug With Apps Displayed on Secondary Monitor

, 29 Nov 2006
Here's some code that will automatically start your app on a secondary monitor if it's compiled with debug info.
// SecondaryDebugDoc.cpp : implementation of the CSecondaryDebugDoc class

#include "stdafx.h"
#include "SecondaryDebug.h"

#include "SecondaryDebugDoc.h"

#ifdef _DEBUG
#define new DEBUG_NEW

// CSecondaryDebugDoc

IMPLEMENT_DYNCREATE(CSecondaryDebugDoc, CDocument)

BEGIN_MESSAGE_MAP(CSecondaryDebugDoc, CDocument)

// CSecondaryDebugDoc construction/destruction

	// TODO: add one-time construction code here



BOOL CSecondaryDebugDoc::OnNewDocument()
	if (!CDocument::OnNewDocument())
		return FALSE;

	// TODO: add reinitialization code here
	// (SDI documents will reuse this document)

	return TRUE;

// CSecondaryDebugDoc serialization

void CSecondaryDebugDoc::Serialize(CArchive& ar)
	if (ar.IsStoring())
		// TODO: add storing code here
		// TODO: add loading code here

// CSecondaryDebugDoc diagnostics

#ifdef _DEBUG
void CSecondaryDebugDoc::AssertValid() const

void CSecondaryDebugDoc::Dump(CDumpContext& dc) const
#endif //_DEBUG

// CSecondaryDebugDoc commands

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.


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


About the Author

John Simmons / outlaw programmer
Software Developer (Senior)
United States United States
I've been paid as a programmer since 1982 with experience in Pascal, and C++ (both self-taught), and began writing Windows programs in 1991 using Visual C++ and MFC. In the 2nd half of 2007, I started writing C# Windows Forms and ASP.Net applications, and have since done WPF, Silverlight, WCF, web services, and Windows services.

My weakest point is that my moments of clarity are too brief to hold a meaningful conversation that requires more than 30 seconds to complete. Thankfully, grunts of agreement are all that is required to conduct most discussions without committing to any particular belief system.

You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.160518.1 | Last Updated 29 Nov 2006
Article Copyright 2006 by John Simmons / outlaw programmer
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid