Painting Issues In MFC MDI applications on Windows 7 Boxes

You may see painting issues with MFC MDI Office Style Applications when resizing or moving the window around as shown below   This bug is caused by different values returned by GetSystemMetrics() under VS 2010 and VS 2012 (the issue was discussed here: https://connect.microsoft.com/VisualStudio/feedback/details/753224/regression-getsystemmetrics-delivers-different-values . If you are hit by the issue, it can be…


Robots are back!

  Robots will soon be in action moving around you, to make your life easier. This is not the tagline from the Hollywood movie “I, Robot” but is a real life fact! Yes, this is a dream come true. In the third week of November 2008, we proudly introduced Microsoft® Robotics Developer Studio 2008 (RDS),…


Floating point exception in managed code results in Access Violation crash

  Suppose you are calling some native code from your managed code, and you observe an Access Violation crash soon after returning from the native code inside your managed code. if you run the application inside the Visual Studio debugger you will see the following exceptions in the output window if IDE.   First-chance exception…


Runtime binding in VC++ 2008 SP1

As George has mentioned in his blog, the VC++ Runtime binding has been changed since VC++ 2008 SP1.  Now by default the manifest contains a reference to the RTM version of CRT. The msdn article has a section How to Bind to Specific Versions which states as follows: Excerpts: If you want to force your…


Troubleshooting CRT heap corruption

This article focuses on troubleshooting a heap corruption caused by writing into the next allocated block. Heap corruption comes into notice when the overridden memory is accessed, leaving in a state where it becomes hard to figure out the original code that is overriding the memory.   In this scenario, call stack could look like…


The Cup-Stacker Prince (Multi-threading Made Easy, and a little bit strange)

Computers are not intuitive; they can predict the future perhaps, but they cannot paint magic doors through the boundaries of traditional logic – at least not yet. Imagine, if you will, a cup-stacking champion during his or her early life. How does one begin stacking cups? Very carefully, as the saying goes. At first, a…


VC++ application fails with R6034 "An application has made an attempt to load the C runtime library incorrectly."

Visual C++ application fails with the runtime error R6034 “An application has made an attempt to load the C runtime library incorrectly.” There can be many reasons for the crash. We should check some of the obvious reasons for it. I have listed some of them here: 1. Check to see if the manifest has multiple…


Using context sensitive help for submenu items within an MFC Feature Pack application

You create a sample MFC feature pack based SDI/MDI application with context sensitive help support. However, the context sensitive help may not work with submenu items. This blog attempts to get this working.   Figure 1: Context sensitive help for submenu item “View | Application Look | Office XP”   By default, when you create…