Browsed by
Month: June 2021

Debug Tools

Debug Tools

When working with STL containers, smart pointers, and boost signals, it is nice to debug directly into your own code without making side trips into container internals. These configs also provide custom object views which make debugging easier in MSVC. To Use You need to reference these files from your project or copy them into <user>\Documents\Visual Studio ####\Visualizers. If you copy them, you must copy the files directly, VS will not recognize any files in subfolders. VS will usually detect…

Read More Read More

Invoker

Invoker

Some code, including direct UI updates, needs to run directly on the main application thread. When application code becomes increasingly parallelized, we need a simple, easy pattern to invoke back to the main thread which can be used directly across our applications. The standard way to invoke in MFC would be to create a new WM_USER message and handler for every method which needs to be invoked. This works, but gets very clunky when creating a large number of invokes….

Read More Read More

Leaky Destructors

Leaky Destructors

When dealing with inheritance, it is possible that the destructors for our objects may never be called if the class has virtual functions, but the base class has a non-virtual destructor. This leads to our derived classes being inadvertently leaky as we leak any memory allocated within the derived class. A detailed description of this bug is available in a Microsoft DevBlog writeup available at: C4265, Part 1 C4265, Part 2 Since this error is not always easy to detect…

Read More Read More