AfxBeginThread fails to create thread on Windows XP

How can AfxBeginThread fail when there are plenty of resources available and the application is a multi threaded one. That’s what I thought when I saw this issue from a customer. I went and read the documentation for AfxBeginThread and I didn’t see anything unusual that customer is doing. He also mentioned that CreateThread fails…

0

Having common intermediate directory causes all project targets to be deleted

While debugging one of my customers’ scenarios, we came across an interesting issue were if we ‘rebuild’ the application we get a warning for a missing file, and for the same application when we ‘build’ everything works fine. All this occurs only in VS2010 and not in the earlier versions of Visual Studio. To understand…


Output from Exec task resulting in build failure

[Notice: This blog is based on Visual Studio 2010 SP1] One of our customers sometime back came to us with a strange issue. They were facing the following error as shown in below screenshot… The source of the error was from an MSBuild task they had. This is how the task looks…<snip>…  <Target Name=”SomeTask” AfterTargets=”Build”>  …

1

Why autoexp.dat data visualizer entries are ignored at times

We had a customer who had issues with autoexp.dat. He added few data visualizers in autoexp.dat file but somehow none of them took effect in the debugger windows like Autos, Locals, etc. We initially thought the issue is with the way he gave format specifier in autoexp.dat file. After several corrections/trials nothing seemed to take effect….

4

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

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

VC++ Intellisense

Internal Mechanism Internally the Visual Studio IDE interacts with editor and the language parsers to create a list of tokens that are updated frequently. In this process the background threads continuously update the Intellisense database. The priority of threads change automatically to make sure that the database is updated as and when user writes the…

1

Porting C++ native code to managed (/clr) – Threads

In native world, one interacts with OS directly by calling Win32 APIs for managing resources (like allocating/deallocating memory,opening/closing handles). In managed world one  relies on CLR totally or at times partially for doing the same( eg GC does memory management for us).Due to lack of understanding of the way CLR does the work for us,  we may at times conclude…

1

Sort function of STL Gives Unexpected Output when Vector is a Type Derived from _com_ptr_t

  C++ code which contains an STL vector containing types derived  from  the_com_ptr_t  COM smart pointer class and using the std:sort() function to sort interface pointers may give unexpected sort output._com_ptr_t COM smart pointer derived types are commonly created when using the ‘#import’ keyword in C++ to import a COM type library. For example: #import…

2

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…

0