Video & On-Demand

Writing Native Win32 Applications with WinLamb and Modern C++ -- Richard Thomson

Utah C++ Programmers has released a new video:

Writing Native Win32 Applications with WinLamb and Modern C++

by Richard Thomson

From the video description:

The Win32 Windows API has been around for decades as a C API for GUI applications. At its heart, every Win32 application is a program that receives messages from Windows, decodes those messages and dispatches them to appropriate code for handling the message.

Graphical user interfaces are a natural fit for object oriented programming and C++ GUI frameworks like MFC (Microsoft Foundation Classes) were created to make writing GUI applications easier.

As Win32 applications evolved to incorporate COM (Component Object Model) objects, a need to write small components adhering to well defined interfaces became more important. Writing such components with MFC results in a heavyweight object and additional deployment dependencies. C++ libraries like ATL (Active Template Library) addressed the need to create interoperable binary components that were lightweight with minimal or no deployment dependencies.

The Windows Template Library (WTL) took the lessons learned from writing small COM objects with ATL and applied them to writing complete Win32 applications. The result is a complete library for writing Win32 applications using the static polymorphism of templates instead of the dynamic polymorphism of MFC.

Are there other ways to look at writing Win32 applications?

WinLamb is similar to WTL in that they are both header-only libraries that wrap the Win32 API. While a WTL program uses message map macros to select the appropriate handler for a message, WinLamb uses lambda functions for the message handlers and an internal dispatching mechanism.

This month, Richard Thomson will give us a walk through of using WinLamb to create Win32 applications. We'll look at how to create an application from scratch with CMake and using the project wizard in Visual Studio. (Since our application isn't cross-platform, but Windows only, we won't lose anything by using Visual Studio's wizard.)

From this skeleton application, we'll look at:

  • how to add message handlers to the main window
  • how to add controls to the main window
  • how to define and use resources
  • how to use a dialog box as the main window
  • how to separate GUI logic from application logic
  • Win32 API helpers provided by WinLamb

https://www.youtube.com/watch?v=2K52YX-vHv4

The C++ Language: Present and Future -- Daniel Garcia

This year we had a wonderful C++ start at Universidad Carlos III de Madrid. The Department of Computer Science and Engineering was honored to have Prof. Bjarne Stroustrup giving a seminar on C++ to start the semester.

We are always happy to have Bjarne Stroustrup with us. Since 2019 he holds a Honorary Doctorate by Universidad Carlos III de Madrid and he has visiting us several times.

Both talks were very well attended with a nice mix of professional developers from industry, students (bachelor, masters and PhD) and researchers and professors from several different departments.

This is a short summary of the two talks he gave:

Day 1: C++ 20: Reaching the aims of C++.

About the video

Out of necessity C++ has been an evolving language. I outline some early ideals for C++, some techniques for keeping the evolution directed, and show how C++20 comes close to many of those ideals. Specific topics ncludes type-and-resource safe code, generic programming, modularity, the elimination of the preprocessor, and error handling. Naturally, over the years, C++ has acquired many “barnacles” that can become obstacles to developing elegant and efficient code. That has been a recognized problem since the early days of C – Dennis Ritchie and I talked about it – so we must distinguish between what can be done and what should be done. The C++ Core Guidelines is the current best effort in that direction.

Day 2: Type-and-resource Safe programming in ISO Standard C++.

About the video

You can write C++ with no violations of the type system, no resource leaks, no memory corruption, no garbage collector, no limitation of expressiveness or performance degradation compared to well-written modern C++. This talk show how this can be achieved – and guaranteed – by the applying the C++ Core Guidelines, simple supporting libraries (mostly the ISO C++ standard library), and static analysis.

Many examples demonstrate how this can be done with code that’s dramatically simpler than older C++ (and C) code. This talk will touch upon RAII, type deduction, span, range checking, nullptr, initialization, invalidation,  casting and variants.


 

CopperSpice: A Peek at C++23

New video on the CopperSpice YouTube Channel:

A Peek at C++23

by Barbara Geller and Ansel Sermersheim

About the video:

C++23 is about to be published and we selected five of the most interesting changes. Two of these are enhancements to Lambda Expressions and the other three add new functionality.

Watch our new video to find out how the C++23 standard can improve readability, maintainability, and performance.

Please take a look and remember to subscribe.

Writing Functors with Boost.Lambda2 -- Richard Thomson

Utah C++ Programmers has released a new video:

Writing Functors with Boost.Lambda2

by Richard Thomson

From the video description:

Lots of standard algorithms require some sort of 'functor' or 'function object' in order to apply predicates and transforming functions to values. This makes the algorithms generic, but requires you to write your own function object classes or lambda functions, which can get a little noisy in the syntax.

Boost.Lambda2 is a library that allows you write lambda functions that look like simple expressions with placeholders for the arguments.

This month, Richard Thomson will give us a breakdown of the Lambda2 library in Boost that makes writing function objects simple and readable. We'll see how to use them with common standard algorithms before looking a little more deeply into how this library is implemented.

https://www.youtube.com/watch?v=3605p3oRwxY

I'll Build Myself -- Phil Nash

Screenshot_2023-01-02_112437.pngA new instant classic for the new year, by the great Phil Nash of C++ on Sea...

Mike Shah's Modern C++ YouTube Series -- Mike Shah

Mike Shah's Modern C++ YouTube series has recently posted the 100th video. 

The freely available YouTube series adds 1-2 videos a week on Modern C++ or other related C++ topics.

Modern C++ YouTube Series

by Mike Shah

About the videos

The series can be watched from start to finish, or otherwise as a complement to those studying C++ from a text to learn about specific C++ language features.