Click here to Skip to main content
Click here to Skip to main content

Tagged as

Image Watch Add-in for DevStudio 6.0

, 12 Jun 2003
Rate this:
Please Sign up or sign in to vote.
A debug tool to Display the Images in CDC, HDC, HBITMAP, Data in a complex arrays, etc. just like Quick Watch in VC, without adding code to your project.
<!-- Add the rest of your HTML here -->

What is "Tom Watch Image"?

To see the contents of HDC, HBITMAP, etc, is very important when debugging Image Processing or UI programs. Usually we can seen the contents of them by BitBlting them to a screen DC or saving them to a file but cannot see the contents of them step by step when tracing in codes. "Tom Watch Image" can do this. It is a Devstudio addin, can view the image in HDC, etc without requiring any additional code to be inserted into your code. You select the variable, and view it like "Quick Watch" does in Devstudio.

What is "Tom Watch Data"?

Another thing that bothers me is that VC can only watch simple array expressions, such as pData,100, to see the 100 elements in array pData. What I want to do is to watch the expression array like pStructer[i].pData[j] , i = 0 to 100, j = 0 to 100, etc. The "Tom Watch Data" Addin can do such jobs for you.

Installing the Addin

Install the "Tom Watch" addin by selecting the "Tools-Customize" Menu in VC and then the "Add-ins and Macro Files" sheet. Then use the "Browse" Button to select the TomWatch.DLL file.

Usage

In the demo project, I put some commentary in the Scribvw.cpp OnDraw() function. You can watch the contents of memDC.m_hDC, bmp.hOjbect, Complex Arrays, etc. to demonstrate the "Tom Watch" tools. Just put breakpoints at appropriate locations then run the demo. When VC breaks at the locations you can select the Tom Watch Image/Data function to watch. The following figures indicate the steps.

Fig1.view the content of memDC.m_hDC by Tom Watch Image Function

<!------------------------------- STEP 3 ---------------------------><!-- Add the article text. Please use simple formatting (

,

etc) -->

Tom Watch Image Usage

  • Select the Expression, such as m_memDC.m_hDC. The expression can be in a comment.

  • Select Tom Watch Image Button

  • Select the Process to be debugged. Nnormally it is selected automatically.

  • Select the variable type, HDC, or HBITMAP, or ,....

  • Press the Watch Button to view. If the expression cannot be evaluated (e.g. a NULL), the watch button will be grayed.

Fig2 View Complex Expression array by Tom Watch Data

Tom Watch Data Usage

  • Select Tom Watch Data Button

  • Open a saved expression list, or add a new expression by pressing the "Add" button

  • The "Add" Button will insert a entry in Tree List, and you can modify it to your needs by clicking it, when it will change to Edit Label mode. (DEL, Ctrl+V, etc. cannot used, you must use the Right-Button menu to Copy, Past, Cut, and the backspace key to delete). Editting the label to empty will delete the expression.

  • When in debug mode, you can Press "Refresh" to Refresh the expression value.

  • Expand the tree to see elements of expression array.

The utility hasn't been fully tested due to time constraints. It is a utility to help my work. so I've tested it only in my work. I use VC6, win98. (Any Bug can send to me by email, thanks a lot)

Other Functions

This Addin also includes some other tools to help your work, some of them are picked from other people's article. I modified them to fit my habits. so they may not fit your habits. You can select the option button to show the options dialog, and select the "Tips on other functions" to see the tips of following functions and related Acknowledgments:
  • Open Project Folder or Dos Prompt, Thanks to Mark Wickman, I learned how to program DevStudio Addins by reading his article and picking the function code from his article.

  • Switch Header / Source. Thanks to Manish Pansiniya, Bhavesh Pethani, I liked the function and embedded it in my addin.

  • Increase build number automatically. Thanks to Mihai Filimon. I improved the function so now a build without any modifications to code will not increment the build number.

  • Insert Function prototype commentary. You should select the entire prototype if it's broken into multiple lines. If the prototype fits on a single line, you do not need to select the entire prototype, just place the caret in the line.

  • Normal comment. Comment in/out a line from the beginnning (place caret in the line), comment in/out block of code from the beginning of the start line to the end of end line of your selection.

  • Smart comment. Comment in/out a line from the current position. comment in a block of selection, comment out a block of selection only place the caret in the block commentary (needn't select all the block commentary text).

  • Active comment. Thanks to Mihai Filimon, his article Active comments is a good idea, but it is so complex and in some situations it doesn't fit my needs, so I got a cool idea from it and picked some code from it. This active comment places all the information in a commentary line. and you can modify, copy or move easily.

    • If the caret is located on a empty line, popup to insert an active commentary;

    • If the caret is located on an active commentary line, follow the link;

    • If the caret is located on an active commentary line, and cannot follow the link, popup to edit the commentary. I usually put a active commentary linking to MSDN to remind me of some interesting topics. To simplify migrating the active commentary between different computers, I supply a option to change the MSDN folder, if the link in active commentary cannot reached, It will try using the folder.

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

No Biography provided

Comments and Discussions

 
GeneralDiscard the article Pinmemberginz22-Dec-08 18:41 
GeneralVery cool PinmemberETA12-Dec-06 1:37 
QuestionIs it for VS.NET IDE too? Pinmemberrajmishra17-Dec-05 0:47 
QuestionVrey good tools and Question: does it work on Win XP? Pinmemberseazi2-Jul-05 19:29 
GeneralSimilar tool Pinsusslars@no_spam_phobe.com4-Oct-03 23:19 
GeneralRe: Similar tool Pinsusslars@no_spam_phobe.com4-Oct-03 23:21 
GeneralGood one... PinmemberRobert Bielik12-Sep-03 2:02 
QuestionFANTASTIC, but what about source code? PinmemberSimon Hofverberg16-Jun-03 22:11 
AnswerRe: FANTASTIC, but what about source code? PinmemberHuangShansong17-Jun-03 15:01 
GeneralRe: FANTASTIC, but what about source code? PinmemberScott Andrew26-Aug-03 20:37 
GeneralLooks great ... PinmemberGilad Novik16-Jun-03 21:02 
GeneralCarry on. PinmemberEIEN16-Jun-03 20:01 
GeneralAmazing PinmemberJoel Holdsworth13-Jun-03 7:56 
GeneralNotice PinsussAnonymous12-Jun-03 21:39 
GeneralI know the feeling. PinmemberWREY13-Jun-03 4:44 
GeneralRe: I know the feeling. PinmemberHuangShansong15-Jun-03 16:59 
QuestionVS.NET? PinmemberNicolas Bonamy12-Jun-03 20:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web01 | 2.8.140902.1 | Last Updated 13 Jun 2003
Article Copyright 2003 by HuangShansong
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid