Programming

C++ Morsels: Why does C++ distinguish between member and pointer-to-member?

In the bad old days, C was barely more sophisticated than Assembly with fancy macros.

Some would say little has changed. An unattributed quote reminds us that "C combines all the power of assembly language with all the ease of use of assembly language".

C++ Morsels: std::for_each functors member variables

So, picture the situation. You need to iterate the contents of an STL container, performing a given operation on each one.

C++ Morsels: Initializer List Execution Order

Here's a little morsel that might save someone a bit of trouble.

C++ objects can have sub-objects ("has-a") and parent classes ("is-a"). This morsel doesn't concern itself with the parent class's objects but rather the encapsulated sub-objects defined by our very class. These encapsulated sub-objects can be initialized at construction time by an initializer list. Any objects that aren't initialized there you should initialize in the constructor itself, but it's preferred to do them in the initializer list if possible (for a variety of reasons including performance and code cleanliness).

Open a PDF to a Named Destination via DDE in C/C++

We switched to using PDF as the online help format for our new Visual Nature Studio 3 product, which is a switch I greatly welcome. Previously we used non-paginated basic HTML, broken up into over a hundred "chapters", one for each major topic or window in the program. When the user invoked the help menu or F1 key, the software would determine what window was active, and map that to an HTML filename. I would then use ShellExecute to launch the users preferred web browser to view the file in question.

Xenon's MSDN Errata

I've noticed recently that I'm making a lot of annotations and corrections to Microsoft's online Win32 API documentation, and while re-reading one the other day I discovered I can view a list of all the annotations I've made.

In fact, it can be viewed publicly:
http://msdn.microsoft.com/en-us/library/user-xenonofarcticus.aspx?n=0

Why is CS_DROPSHADOW a class style and how do you use it with a Dialog/DlgProc?

Recently, I've been doing some UI work. I program for Windows in C++ on bare-metal Win32 API. No MFC, no WTL, for WPF, no .NET, nothing. I frequently end up having to write my own UI widgets ("Windows Custom Controls" in Microspeak) because most control libraries assume you're using one of the above technologies. That, and most custom controls have annoying feature or performance deficiencies. So, I'm pretty good at hacking on the Win32 API.

Syndicate content