Bug Reports: Memory Leak in VC++ PPL and ASAN support in MFC

Today, I just filed 2 bug reports on Visual C++: Memory Leaks in VC++ PPL's parallel_for_each() reported by Deleaker and MFC support in Address Sanitizer. The latter is having linkage issue of duplicate symbols of new/delete operators that exists in both MFC and Clang ASAN. I need your help to upvote these 2 bug reports …

Direct2D Tutorial Part 1: RenderTarget

Introduction Direct2D is introduced to phase out the dated GDI+ in 2009 and is supported on Windows 7 or newer. This is the first in an introductory Direct2D tutorial series. In this tutorial, we are going to take a look at various different RenderTarget. Think RenderTarget as a canvas to draw on. We focus on …

C/C++: Allocate Variable-size Arrays on the Stack

C language provides the alloca function to allocate arbitrary size array on the stack. After the function returns or the scope ends, the stack memory is automatically reclaimed back(popped back) without the developer having to deallocate it explicitly and thereafter is unsafe to access it again from another function. The below code shows allocating fixed …

Address Sanitizer in Visual C++

In this blog, I'll demonstrate on how to utilize Address Sanitizer (ASan) in Visual C++ to check for memory problems. MSVC team ported the Clang ASan to the Windows platform in 2019 and since it is still at the experimental stage, be sure to expect kinks to be ironed out. Before using Address Sanitizer in …

C++23: Mutable string_view

In the upcoming C++23, the mutable string_view proposal is under review for inclusion in the next Standard Library. As we all know the current immutable string_view has two members, a const pointer to a constant char array and a constant length whereas in the mutable sibling, both members are modifiable. Let me illustrate with a …

Visual C++ 6.0 Developer’s Reference

Came across this picture of Visual C++ 6.0 Developer's Reference(1998) posted by raddevus. I had a C++ Master Reference published in 1999. It has 1500 pages of C++ language and library reference! I had perhaps only read one page(about atoi()). It is like a predecessor of Cppreference except it is printed on book and is …

Running VC++ Executable on User Machine Without its DLLs

Since this question is asked on CodeProject today, I'll answer it here. To deploy without having to install the Visual C++ DLLs, the program has to be linked statically. Linking to C runtime statically: Right-click on your project in the Solution Explorer and select Properties and go to C/C++ -> Code Generation. Select Multithreaded (/MT) …

Floating-Point Article Win January Prize

My floating-point article won the best article prize for the articles posted in month of January 2020. The prize is a priceless CodeProject mug(above picture) which is just delivered to my house. The impetus to writing this article started with a rule enshrined in the company wiki that "all multiplications must be converted to divisions …