Advanced debugging: change your program execution without Edit and Continue

Last time (Improve your managed debugging skills: examining registers and memory) we examined some debugging techniques to understand the behavior of managed code.   It might take a long time or many manual steps to reproduce a particular software behavior in an application. Changing the instructions that are executed by the target program while it’s…


Improve your managed debugging skills: examining registers and memory

  I was helping a colleague and we were deep in the middle of a debug session, single stepping some code and we wanted to see a value in the debugger. The debugger showed either nothing, because the intermediate value has been optimized out, or a message like “cannot display value, possibly because it has…


More fun with the Fast Fourier Transform

The sounds that we hear can be recorded via a microphone and can be graphed as a signal of amplitude versus time. Low notes show as a lower frequency wave, and high notes show as higher frequency waves. Over the past few decades, some music players, like a car radio or stereo amplifier, have an…


Using and styling a treeview in WPF

  As you know, a treeview control is very useful for viewing hierarchical information. Each node in a tree can have its own parent/child relationships.   Some of these trees can be extremely large, and can thus be prohibitively expensive to calculate completely. Windows Explorer comes to mind. Outlook Mailbox folders. The game of chess….


Automatic tests protect your code

  Last month  in  Dynamically create huge tooltips in WPF TreeView and ListView I showed some code that creates large tooltips to present lots of data.   Today, we’ll talk about creating automatic tests for this feature.  Testing User Interface features has been difficult historically. How do you automate a mouse hovering over an item?…


Dynamically create huge tooltips in WPF TreeView and ListView

  Tooltips are useful. When the mouse hovers over a button a tip can indicate what happens when it’s clicked. The mouse move does not actually invoke the button, but can give information in a passive way.   Sometimes I want to make huge tooltips. This essentially gives more screen real estate for presenting a…


Returning data from a recursive method

  Sometimes you need to write a method that requires recursion to be elegant. Often that method needs to accumulate data between recursion levels There are many ways to do so, and some are more elegant than others. I like the Optional Parameter method: it requires no additional class or static (shared in VB) members…


Embed a ListView inside another ListView for one to many relationships

In the old days (about 16 years ago), FoxPro’s object, containership and inheritance models made it easy to put objects inside other objects. So, for example, a FoxPro grid of Customers could have a column containing a grid of each customer’s orders, and each order, in turn, could have a grid of the order detail…


Use colors in WPF to show virtual memory fragmentation

In this post What is your computer doing with all that memory? Write your own memory browser is sample code that shows how to create a WPF grid view of a memory map of a process. You can click on a column header to sort, and you can see the various loaded images and even…


The cost of using nothing

What is the cost of using nothing? Seems like a silly question.   Suppose you see code like this:   void *  MyClass::DoSomething() { int size = sizeof(MyThing) * m_NumItems; var ptr = malloc(size); return ptr;}   It’s a method that allocates space for m_NumItems  MyThings.  This is a real code pattern that exists in…