Copying MessageBox text

It is a small pet peeve of mine that many people in software development use screenshots to send around reports of errors in Windows applications. The path of least resistance is to press the Print Screen key and paste the resulting BMP in email. These files can be multiple megabytes. Even if you use alt-PrtScn, which copies just the active window, that's typically 350KB. Moreover, it loses critical information: if the recipient actually wants to grep source code for the error message, he or she must retype the string in question.

Instead, try pressing control-C. This copies the text of any standard messagebox (including assertion failure dialogs) into the clipboard.

Example:

---------------------------
Microsoft Visual C++ Debug Library
---------------------------
Debug Assertion Failed!

Program: temp_demo_project.exe
File: c:\foo.cpp
Line: 40

Expression: 2 == 1

For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts.

(Press Retry to debug the application)
---------------------------
Abort   Retry   Ignore   
---------------------------

Thanks to Adam Dingle for the tip.

Categories

1 Comments

Mary Tsao said:

Adam's the coolest and this tip clearly proves it.

Leave a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

About this Entry

This page contains a single entry by Mike Tsao published on April 10, 2007 4:43 PM.

My son's first joke was the previous entry in this blog.

Waking up early is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Powered by Movable Type 4.2-en