Extracting Information from Crash and Hang Dumps

In order to understand the causes for crashes and hangs, specific information needs to be collected and analyzed. This article describes the four phases of this process. Phase 1: Collect crash or hang dump   There are multiple ways to achieve this, please check this blog post for details.   Phase 2: Install debugging tools…


Building a large text file editor – Part II

In the previous post I created a class that was going to be used as an interface between a large file editor and the file on the disk. Since then I’ve been implementing the user interface and, obviously, the RevisionStream also needed some readjustment. Here are some major changes that were done: – detecting encoding…


Building a large text file editor – Part I

The purpose of this series of two blog posts is to illustrate how an editor for large files can be implemented. The first part will address the model behind the editor whereas the second part will include an actual UserControl that allows users to view and edit large files. The basic idea behind a large…


Monitoring when registry keys are modified

Let’s say you want to see where a certain setting from Word Options is saved in Registry.   The easiest method is using Process Monitor. Add a filter on Process Name and Operation, start Word and that’s that:  If we uncheck “Allow background saves” from Word Options – Advanced – Save, this is what appears in Process Monitor:…


Back to school – Office art geometry

Let’s start off with the following observation- the following two shapes have the same Left and Top coordinates:   What’s different is obviously the rotation. What Office saves for a shape is the Left and Top coordinates together with a Rotation. So the Top coordinate, for instance, is not necessarily the uppermost part of a shape….


Using DDE in C# for Office automation

  Looking for some code samples how to pass DDE messages from a .NET program I found out that there‘s a great library already in place that facilitates working with DDE: the NDde project from Codeplex: http://ndde.codeplex.com/ However, I just needed to make one call and including a new DLL into my code would have…


Using .NET library in VBA

Three easy steps for exporting .NET functionality to VBA: 1. Write a source file:   using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Runtime.InteropServices; using System.Windows.Forms; namespace InteropTest { [Guid(“BEB2C62D-5646-4B08-81DF-670314BFEE4A”)] public class InteropTestClass { public void Help() { MessageBox.Show(“Hello From .NET!”); } } } The GUID needs to be unique. 2. Generate a strong…


Recovering the pictures from a PPT file

  The PPT file format is very well documented as per Microsoft’s Open Specification Promise. However, accessing any part of a PPT file isn’t really a snap. I’ve created a small C# program which parses the \Pictures stream from a PPT file. For that, one needs to: Extract the Pictures stream from the PPT OLE…


Complex editing of XLSX files

  Editing Excel OpenXML documents using the OpenXML 2.0 SDK offers better performace and improved supportability compared to normal Office automation (e.g. VBA). There are also great examples on the Internet to get started: Office Open XML Formats: Inserting Values into Excel 2007 Cells. What I haven’t found until now is some clarifications as to…


Indenting XML files

  The operation of indenting XML files is pretty trivial when using the classes from the System.XML namespace. However, I often find myself trying to read canonical XML code from files. As such, a created a very simple tool that converts XML files to indented XML. All you need to do is to drag and…