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…

0

Targeting the .NET 2 Framework when using AssemblyBuilder under .NET 4

When you use the Reflection.Emit classes to generate a dynamic assembly, the targeted framework for the assembly will be the version of the framework under which you are running the code that generates the dynamic assembly. For instance, you can create a dynamic assembly with the following code: static void Main(string[] args) {     Console.WriteLine(“Creating…

2

C++ class data members not getting correctly initialized due to unbalanced #pragma pack alignment

Sometime back we saw an odd behavior in which C++ class data members were not getting correctly initialized due to memory corruption. It was discovered that this memory corruption was due to an unbalanced #pragma pack data alignment. In our case, this behavior was observed right after the constructor of the class was executed. To…

0

VS2010 : Unable to Hit Breakpoints in Managed Code

In Visual Studio 2010, if you are debugging a native executable which in turn loads a managed DLL built against  a version of the framework previous to version 4, you may find that breakpoints which are set in the managed code are not hit. The breakpoints are displayed correctly, you just never hit them when executing…

5

The "GenerateResource" Task Failed Unexpectedly : Unable to load FileTracker.dll

When building a project in Visual Studio 2010 that contains a .resx file, you may receive the following build error:   The “GenerateResource” task failed unexpectedly. System.DllNotFoundException: Unable to load DLL ‘FileTracker.dll’: A dynamic link library (DLL) initialization routine failed. (Exception from HRESULT: 0x8007045A) at Microsoft.Build.Shared.NativeMethodsShared.InprocTracking.StartTrackingContextWithRoot(String intermediateDirectory, String taskName, String rootMarker)    at Microsoft.Build.Utilities.FileTracker.StartTrackingContextWithRoot(String intermediateDirectory, String…

7

Why do we get System.InvalidCastException when we read through custom Configuration file?

A developer’s life becomes a lot easier by using configuration files.  Configuration files, being XML files, can be changed as needed and developers can use configuration files to change settings without recompiling applications. Administrators can use configuration files to set policies that affect how applications run on their computers. Managed code can use the classes…


IntelliTrace

1. Introduction 2. How it works : a. Events and Call Information b. Recordings – iTrace file c. Capturing Events d. Specify modules e. Intellitrace Window f. Navigation Bar g. Running the trace file 3. Tips 4. Summary   1. Introduction Most developers are familiar with Visual Studio debugger. Up to Visual Studio 2008, you have…

0

Adding a Configuration file for a VC++ DLL

Background   A VC++ application will fail to run if the required Visual C++ runtime libraries are not present on the target operating system (machine).  It’s the manifest of the executable used by the operating system loader to load assemblies that your application depends on.  Any C/C++ program built by Visual C++ 2005/2008 has to include…

1

MFC Feature pack and desktop composition issue

MFC Feature pack application makes it possible to mimic the look and feel of office and outlook, however, when it comes to customization, well, one has to make a few changes to the application to get the desired result.     Problem   I came across a scenario where an MFC feature application carrying office…


Removing the Frame Caption when Using CMFCVisualManagerOffice2007

When BCGSoft created the classes that Microsoft incorporated as the “MFC Feature Pack” in VS 2008 (and included in SP1), it seems their primary intent was to provide a nearly hands-free implementation of several popularly-requested user interface features.  Especially with the “Visual Manager” classes (derived from CMFCVisualManager), it’s clear that the intent was to easily…

5